RE: How to find xpath for Brand dropdown values for below site

Hello,

Seems it’s difficult to get xpath for¬†Brand dropdown values as it is mouseover dropdown.¬†Once we move away mouse from that section that dropdown will be gone.
Link copied here :https://www.nordstromrack.com/shop/Men/Watches

Please let me know, if you have any idea about this.

Regards,
Balu
Senior Quality Engineer, FTD Systems. USA

balukondamuri Default Asked on December 31, 2014 in Selenium WebDriver.
Add Comment
3 Answers

Hi,

Really appreciate for your help. Seem’s the problem is the ‘Brand’ hasn’t have Select tag it has div.

Code:
public void selectWatch(){
Select dp = new Select(driver.findElement(By.xpath(“//*[contains(text(),’Brand’)]”)));
List<WebElement> list = dp.getOptions(); i
nt size = list.size();
for (int i=0;i>size;i++){
String val = dp.getOptions().get(i).getText();
System.out.println(val); }

Output:
FAILED: selectWatch
org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been “select” but was “div”.

Thanks,
Balu

Default Answered on December 31, 2014.
Add Comment

Your Answer

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