Explain me how to execute javascript in selenium?



Explain me how to execute javascript in selenium?..

Answer / Sanjeev Kumar Verma

To execute JavaScript in Selenium, you can use the `executeScript()` method. For example, in Java with Selenium WebDriver, you might call `String result = (String) driver.executeScript("return document.title;");` to get the title of the current page as a string.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

How you can handle colors in web driver?

1 Answers  


How to press enter key on text box in selenium webdriver?

1 Answers  


What are some advantages of selenium?

1 Answers  


How to run a group of test cases using testng?

1 Answers  


What is junit annotations and what are different types of annotations which are useful?

1 Answers  


What is selenium rc?

1 Answers  


Who is the best faculty for selenium in twin cities (Hyderabad/secundrabad)

2 Answers   KJL, NA,


What is the difference between @factory and @data provider annotation?

1 Answers  


What do you know about Selenium IDE?

1 Answers  


How many exceptions do you know in selenium webdriver?

1 Answers  


List out different types of locators?

1 Answers  


Explain Cucumeber Framework?

1 Answers  


Categories