How to Run Java Script using Selenium Webdriver.
WebDriver driver=new AnyDriverYouWant()
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("write ur java script here ");
OR
WebDriver driver = new AnyDriverYouWant();
if (driver instanceof JavascriptExecutor) {
((JavascriptExecutor)driver).executeScript("yourScript();");
}
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("write ur java script here ");
OR
WebDriver driver = new AnyDriverYouWant();
if (driver instanceof JavascriptExecutor) {
((JavascriptExecutor)driver).executeScript("yourScript();");
}
0 comments:
Post a Comment