How do you find element using Java Script?

Answer Posted / grbhniti@yahoo.co.in

Hi,
By using javascriptexecutor we can perform tasks as below
I am entering text in textbox by passing ID.

JavascriptExecutor js= (JavascriptExecutor)driver;
js.executeScript("document.getElementById('vfb-9').value='Ramchandra Patil'");

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What exactly is the price of selenium test-suite?

524


What are the features of testng and list some of the functionality in testng which makes it more effective?

603


What is object repository? How can we create object repository in selenium?

555


What are the test types supported by selenium?

596


Tell us how many exceptions do you know in selenium webdriver?

541






How to handle a dropdown in selenium webdriver?

2596


What kind of mouse actions can be performed in selenium?

552


What is the purpose of selenium ide?

657


Is there a way to refresh browser using selenium?

586


What kind of testing does selenium support?

561


Mention what is desired capability? How is it useful in terms of selenium?

564


What are the ways to refresh a browser using selenium webdriver?

549


How to check if a text is highlighted on the page ?

781


How to get a text of a web element?

590


How to handle hidden elements in selenium webdriver?

570