How do you find element using Java Script?

Answers were Sorted based on User's Feedback



How do you find element using Java Script?..

Answer / 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 ?    11 Yes 0 No

How do you find element using Java Script?..

Answer / chetan phani.j

By using executeScript()

Is This Answer Correct ?    1 Yes 0 No

How do you find element using Java Script?..

Answer / kaviya

element.getElementsByTagName(tagname)

Is This Answer Correct ?    0 Yes 12 No

Post New Answer



More Selenium Interview Questions

What if you have written your own element locator and how would you test it?

0 Answers  


What is the purpose of creating a reference variable- ‘driver’ of type

0 Answers  


What are the advantages and disadvantages of selenium ?

0 Answers  


How to switch to a new window (new tab) which opens up after you click on a link?

0 Answers  


What is soft assertion in selenium?

0 Answers  






How can we fetch a text written over an element?

0 Answers  


What is the difference between find elements () and find element ()?

0 Answers  


Mention what are the types of listeners in testng?

0 Answers  


How do you handle frames

1 Answers  


How can we handle windows based pop up?

0 Answers  


What are the different types of wait statements in selenium webdriver? Or how do you achieve synchronization in webdriver?

0 Answers  


What is selenium 1.0?

0 Answers  






Categories