How to Find class inside in <article>, using Selenium WebDriver -


here code:

<div class="padding-tlb">  ....some code.... </div>     <article class="non-article-login">           <div class="one-fourth-percent columns-percent">&nbsp;</div>           <div class="one-half-percent columns-percent">             <div class="one-fourth-percent columns-percent">               user id             </div>      </div>      </div>         </article> 

i want check if exist class "one-fourth-percent columns-percent".

   webelement test = driver.findelement(by.classname("one-fourth-percent columns-percent")); 

but doesn't works, here error:

org.openqa.selenium.invalidselectorexception: given selector one-fourth-percent columns-percent either invalid or not result in webelement. following error occurred: invalidselectorerror: compound class names not permitted

but if try find article class - it's fine. it's like, outside of article class works. fine:

  webelement test = driver.findelement(by.classname("padding-tlb")); 

how inside article class, , check values?

compound classes not allowed in webdriver. invalidselectorerror telling you. best option select cssselector instead. like:

webelement test = driver.findelement(by.cssselector("one-fourth-percent.columns-percent")); 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -