Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium RC Having problems with XPath
    text
    copied!<p>I'm using Selenium RC with chrome-mode for Firefox to automate test cases for a web application. I'm writing the scripts in Java using TestNG framework and Eclipse. Now to the main point:</p> <p>I'm having problems with Selenium RC for recognizing certain XPaths. I validate my XPaths with XPath-Checker extension for Firefox which shows no error. I then try it out in Selenium IDE to make sure that XPath is being recognized. Even IDE recognizes the element. But its the Selenium RC just doesnt recognize it. Is there anything I can do to correct this?</p> <p>Specifically, I'm trying to click on a particular area given by:</p> <pre><code>html/body/form/div[@id='someid1']/div[@class='someClass']/div[@id='someid2']/div[@id='someid3']/div[@id='someid4']/div[@title='titleOfTheElement'] </code></pre> <p>Then I also tried:</p> <pre><code>//div[@title='titleOfTheElement'] xpath=//div[@title='Automated User'] xpath=/descendant::div[@title='Automated User'] </code></pre> <p>Still nothing!</p> <p>1) Can someone please suggest what could be wrong, or whether Selenium is known to have problems with XPath? </p> <p>2) Isn't there any addon (similar to XPath checker) that helps us to see things the way Selenium RC sees? This way we could be sure whether RC is going to recognize the XPaths.</p> <p>Thanks,<br> Mugen</p> <p><strong>Here is the Selenium code:</strong></p> <pre><code>selenium.click("somelink"); selenium.waitForPageToLoad("30000"); boolean flag=false do{ if (selenium.isTextPresent("Some text on the page which loads last")) { flag=true } }while(flag=false); selenium.click("locator for area which is driving me crazy"); </code></pre> <p>Now at the last step if I were to click anywhere else on the page (meaning some other locator) the click would work.</p> <p><strong>The HTML for the area looks like this:</strong></p> <pre><code>&lt;div id="someid1" style="overflow: hidden;"&gt; &lt;div id="someid2" title="title1" class="someclass"&gt;title1&lt;/div&gt; &lt;div id="someid3" title="title2" class="someclass"&gt;title2&lt;/div&gt; &lt;div id="someid4" title="required title" class="someclass"&gt;required title&lt;/div&gt; &lt;div id="someid5" title="title3" class="someclass"&gt;title3&lt;/div&gt; &lt;div id="someid6" title="title4" class="someclass"&gt;title4&lt;/div&gt; &lt;div id="someid7" title="title5" class="someclass"&gt;title5&lt;/div&gt;&lt;/div&gt; </code></pre> <p>Thanks a load for looking into this. :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload