Collectives on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more
I am using Selenium IDE in Chrome.
I have trouble as it's
Ext JS
, so certain class names are generated. I also might be having trouble due to the class name
"x-list-body"
?
I want to click on
"This person here yes"
, like this:
Click: //div[@class='x-list']//em[.='This person here yes']
Here is the HTML from the webpage, excuse the mess:
<div class="x-list-body">
<div id="ext-gen159" class="x-list-body-inner">
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">Woot Moot Boot</em>
<div class="x-clear">
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">This is sparta</em>
<div class="x-clear"></div></dl>
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">Henry Print</em>
<div class="x-clear"></div>
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">Minsy Blowman</em>
<div class="x-clear"></div>
<dl class="">
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">This person here yes</em>
<div class="x-clear"></div>
<dl class="">
<dt style="width:100%;text-align:left;">
<em unselectable="on" "="">Another cool person</em>
<div class="x-clear"></div>
Please do not give me JavaScript code etc..., I am using the FireFox addon IDE.
Thank you!
–
–
–
–
Yes, class name is a problem. If you don't want an exact match, then change selector to match partial class name:
//div[contains(@class,'x-list')]//em[.='This person here yes']
Also since you are selecting a very particular text, you may not even need that div selector, unless another em on the page has exactly the same text. I.e. you may be able to use:
//em[.='This person here yes']
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.