How to select a value from a drop-down?

Answer Posted / dileep kumar

by using select keyword we can select a value from dropdown box
select select = new select (driver.findelement(by.xpath(" xpath")));
select.selectbyindex(2);
select.selectbyvalue(2);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is the latest Selenium tool?

661


Explain how you can handle colors in web driver?

672


List out the technical challenges with selenium?

579


How to get an attribute value using selenium webdriver?

637


Can you run the tests registered with Selenium IDE in other browsers?

626






Write a code snippet to perform right-click an element in webdriver.

573


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

655


How to test ajax application with selenium?

578


Hi can anyone suggest me what type of non technical questions asked in interview for experienced people, I am trying to get job with fake experience can anyone help me please

983


What is the use of deselect all () method?

590


How can we fetch title of the page in selenium?

596


How many types of waits in selenium?

546


Tell us can you write the code to double click an element in selenium?

541


What is the main difference between the close() and quit() methods?

517


What are the limitations of selenium?

533