After whole lot of search for many days I am asking for help here.
We have a setup where we are using javascript + selenium(webdriverjs).
We want to pass data in the browser which is opened via selenium. putting it simply, we want to execute any kind of javascript in the browser.
In java+selenium, we have JavaScriptExecutor class which does this thing. In javascript+selenium I am not able to find any thing similar to it.
I have experimented with driver.executeJavaScript and driver.executeScript. But that does not work.
Please help.
Note: I can't use protractor in my project.
After whole lot of search for many days I am asking for help here.
We have a setup where we are using javascript + selenium(webdriverjs).
We want to pass data in the browser which is opened via selenium. putting it simply, we want to execute any kind of javascript in the browser.
In java+selenium, we have JavaScriptExecutor class which does this thing. In javascript+selenium I am not able to find any thing similar to it.
I have experimented with driver.executeJavaScript and driver.executeScript. But that does not work.
Please help.
Note: I can't use protractor in my project.
Share Improve this question edited Oct 12, 2018 at 10:58 IndexOutOfDevelopersException 1,3547 gold badges15 silver badges28 bronze badges asked Oct 12, 2018 at 9:37 PramodPramod 8481 gold badge13 silver badges28 bronze badges1 Answer
Reset to default 7here you go an example protractor
browser.executeScript('window.scrollTo(0,0);');
async execution
browser.executeAsyncScript('window.scrollTo(0,0);');
for webdriver js or other framework try with
driver.executeScript()