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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of waits available in selenium webdriver?

452


How do I upload a file using selenium? I need to upload a word file during test execution.

457


How can we handle pop-ups in rc?

498


Explain in selenium ide how can you debug the tests?

454


Mention different exceptions you had in selenium web driver?

432






How to handle browser (chrome) notifications in selenium?

466


What are soft assert and hard assert in selenium?

432


For database testing in selenium webdriver what api is required?

429


Explain how you will login into any site if it is showing any authentication popup for username and password?

520


How to assert text of webpage using selenium 2.0?

452


what are challenges you faced in your last project?

1012


How to delete browser cookies with selenium web driver?

452


What are the different types of locators in Selenium?

513


What are some of the different ways to find an element using selenium as a tool?

451


What is the use of context menu in selenium ide?

492