添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
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!

How do I use that? This is what my IDE looks like, where do I put it? s32.postimg.org/ln088zfmd/image.jpg Looks like JS to me... – k1308517 Jun 28 '16 at 12:35 I did click: //em[contains(text(),'steve Steve deSilva Job London')] but sadly it just gets highlighted in red, same issue as before sorry. – k1308517 Jun 28 '16 at 12:37 When I use the website normally? I click it and it is highlighted, next I click an arrow. s31.postimg.org/qm15vv6pn/image.jpg – k1308517 Jun 28 '16 at 12:47 similarly we have done click and it is getting highlighted.Then try to click on arrow webelement. – SaiPawan Jun 28 '16 at 12:50

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.