简体   繁体   中英

Handling Sub Menus in Selenium WebDriver

I am Trying to automate an web application developed in (SmartGWT technology)In my test case i have to navigate from one menu to other sub menu and click on a option.

My Code:

Actions builder1 = new Actions (driver);

WebElement Filterselection = driver.findElement(By.xpath(".//*[@id='isc_DYtable']/tbody[2]/tr[14]/td[2]/nobr"));

builder1.moveToElement(TypeColumn).build().perform();


WebElement  ShowHiddenFilter =driver.findElement(By.xpath("//*[@id='isc_EAtable']/tbody[2]/tr[2]/td[4]/nobr")); 

ShowHiddenFilter.click();

I am getting:

Error:org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id='isc_EAtable']/tbody[2]/tr[2]/td[4]/nobr"}

please see the screen shot of the Menu's which i have to navigate.

//*[@id='isc_EAtable']/tbody[2]/tr[2]/td[4]/nobr

CSS or XPATH Use Relative CSS/XPATH. Absolute XPATH will not Work always.

Optimized Way -- Use Relative CSS/XPATH.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM