For scrolling through a section, I wrote below code:
JavaScriptExecutor js= (JavaScriptExecutor) driver;
js.executeScript (scroll code);
but here executeSctipt method is autosuggested like:
js.executeScript(null,args)
and it throw error as null cannot create object. The actual argument (scroll code) is working as expected in the console.
It should be displayed as:
js.executeScript(arg0,arg1);
Using the following Eclipse version:
The perfect suggestions are observed:
Though selecting the suggested option defaults to
null
andargs
but the tooltip still continues to suggest the actual argument types.You can use the
executeScript()
method accordingly:Refrences
You can find a couple of relevant detailed discussions in: