Selenium unhide elements C# -


i have menu group:

<div class="menugroup"> 

some of div contain class hide or show menu contents

class="togglemenuchildren"> 

when click on it, change on

class="togglemenuchildren opened"> 

so want show content menu (click on classes togglemenuchildren) show it.

i try this

iwebelement zi = driver.findelement(by.classname("togglemenuchildren"));             zi.click(); 

but opened (unhide) first element, , if call again hide content. how can show content (click on elements) ?

you can use xpath - //div[contains(@class,'togglemenuchildren') , not(contains(@class,'opened'))]

(sorry in java)

list<webelement> allelements = driver.findelements(by.xpath("//div[contains(@class,'togglemenuchildren') , not(contains(@class,'opened'))]")); for(webelement ele: allelements){  ele.click; } 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -