I have a project in which I have two types of test, once requiring WebDriver and other needing a Custom Queue dependency. When using cucumber its not possible to have two separate Spring config as it does not allow you to run the test of if the Annotation on Step classes are different. Hence I decided to use the Lazy annotations on all the Beans I autowire so that they only get instantiated when needed.
This seem to create a problem wherever I have a JavascriptExecuter cast on the WebDriver instance as its a proxy and not a real instance of WebDriver. It complains that it cant cast a com.sun.proxy.$Proxy26 to JavascriptExecuter.
This is also seen when trying to cast WebDriver to HasInputDevices interface when using the Actions class.
It seems its happening when an WebDriver is cast into an interface.
Has anyone come across this and is it possible to lazily instantiate the WebDriver object and have it cast as we desire.
P.S. I cant break the test framework into two as there's dependency of one project on the other.
Thank you, John