c# - Use SmartMenu with Selenium WebDriver -


i have smartmenu in web app need test selenium. can find root menu items partial link text none of sub menu items can found.

has found way this?

here code:

var menu = iebrowser.driverinstance.findelement(by.id("main-menu")); var navigate = menu.findelement(by.partiallinktext("navigate")); navigate.click();  var offsite = navigate.findelement(by.partiallinktext("off-site")); offsite.click(); 

i "nosuchelementexception" on line 5.

i tried:

var menu = iebrowser.driverinstance.findelement(by.id("main-menu")); var navigate = menu.findelement(by.partiallinktext("navigate"));  actions = new actions(iebrowser.driverinstance); a.movetoelement(navigate).build().perform(); a.click();  var offsite = navigate.findelement(by.partiallinktext("off-site")); a.movetoelement(offsite).build().perform(); a.click(); 

this fails on "offsite" var.

i managed locate elements using

var offsite = menu.findelements(by.tagname("a"))[2]; 

i don't know why worked , by.partiallinktext didn't.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -