RE: How to Retrieve the values from a drop down using selenium-WebDriver?

I am using below script to retrieve specific item from drop down but it’s not working.

Select  salTitle =  new Select(driver.findElement(By.id(“s2id_QuickEnquiryForm_salutation”)));
 salTitle.selectByVisibleText(“Mr.”);

showing below Error in console “Exception in thread “main” org.openqa.selenium.suppo

RE: How to Retrieve the values from a drop down using selenium-WebDriver?

rt.ui.UnexpectedTagNameException: Element should have been “select” but was “div””

I am using selenium + javascript.can anyone here suggest a method to select an item from a dropdown menu.

please find the Below HTML,Source code for your reference!!

please find the attached image for HTML code of Specific to that field.

I welcome any input!

Thanks in advance!!

Uday Train Asked on December 29, 2014 in Selenium WebDriver.

This is a very beautifully asked question. Thanks Uday!

on December 31, 2014.
Add Comment
4 Answers

Hi Uday,

Did this not work for you?

http://www.toolsqa.com/selenium-webdriver/dropdown-multiple-select-operations/

Thanks
Virender

Professor Answered on December 31, 2014.

yes virender..The above mentioned link not working for me.
I want for div tag not for  select tag

on December 31, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.