Thanks for taking the time to ready my questions. I need to mouseover then mousedown on an image (cog.png) for a specific node child represented by text to the right of an image. I can successfully Target the class but cannot work out how to target the image alone.
HTML, I want to target the cog.png near 'Australia'
<div id="tree" class="">
<ul class="dynatree-container dynatree-no-connector">
<li class="dynatree-lastsib">
<span class="dynatree-node dynatree-expanded dynatree-has-children dynatree-lastsib dynatree-exp-el dynatree-ico-e"></span>
<ul style="">
<li class="">
<span class="dynatree-node dynatree-exp-c dynatree-ico-c" style="background-color: transparent;">
<span class="dynatree-connector"></span>
<img alt="" src="/icn/cog.png"></img>
<a class="dynatree-title" title="This option is Active" href="#">
Australia
</a>
</span>
Target code for Selenium IDE (which targets the full span, I just want the image cog.png)
//span[contains(@class,'dynatree-node') and //img[@src='/icn/cog.png'] and .//text()='Australia']
I tried
//img[@src='/icn/cog.png']
Not surprisingly it was not specific enough and targeted the first instance of the image
Versions
- Firefox 32.0.3
- Selenium IDE: 2.7.0