How to execute javascript in selenium?



How to execute javascript in selenium?..

Answer / Sushil Nath

To execute JavaScript in Selenium, you can use the `executeScript` method. For example: `String result = (String) driver.executeScript('return document.title;');`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

Tell me why to choose python over java in selenium?

1 Answers  


What is assertion in selenium?

1 Answers  


Which is the command used for displaying the values of a variable into the output console or log?

1 Answers  


What is the difference between the commit and verify commands?

1 Answers  


How to retrieve css properties of an element?

1 Answers  


What are selenium 1 and selenium 2?

1 Answers  


How does you identify the list of links present on the page

1 Answers  


what is the difference between keys.enter and keys.return in selenium? i have used both and both performed enter.

1 Answers   JPMorgan Chase, Tech Mahindra,


what are the four parameter you have to pass in selenium?

1 Answers  


What is the difference between “/” and “//” in xpath?

1 Answers  


Which is the super interface of webdriver?

1 Answers  


What is the difference between the “type” and “typeAndWait” commands?

1 Answers  


Categories