April 5th, 2013, 04:08 AM
Help - css selector (testing in Selenium)
I am a tester using selenium, and I mainly use CSS selectors.
I have a recurrent problem to express a selector in such cases :
<div class="rich-menu-item-icon" >Mobile Applications</div>
<div class="rich-menu-item-icon >Applications</div>
I don't know what the name for this "stuff" between >< (>this stuff< , in example, Mobile Applications or ApplicationS.
This seems really simple, but as I don't find the qualifier to express this, I can express equality.
In most cases i can use css=div:contains(value), but I sometimes need to be more precise and use equality : here if I use css=div:contains(Applications), the first div will be selected too.
May be there is another way to do ...
I am a tester, the html is generated by framework and developers cannot add an attribute so that I can test it.
I did not manage to use regexp either.
I anyone could help me, I would be very grateful
Thanks in advance
April 5th, 2013, 11:24 AM
Hopefully someone else with more knowledge will "chime in" and give you more to go on.
EDIT: I decided to do some "googling" to find out about Selenium CSS Selectors and ran across THIS article that may help.
Last edited by DonR; April 5th, 2013 at 02:34 PM.