Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


The below xpath which is captured for links in selenium IDE is not running in Selenium RC.
The links are designed in XML.

selenium.ClickAt("xpath=/html/body/div/div[2]/ul/li[3]", "");
selenium.ClickAt("xpath=/html/body/div/div[2]/ul[2]/li[2]/span", "");

The links are from the five links we need to click on Administration and from that we need to click on client user.

As Admin-->Client User

share|improve this question
can you post the relevant XML/HTML so we can see if there are any improvements that can be made to the XPaths? – rishimaharaj May 29 '12 at 12:27
1. Can you successfully re-run the test in the Selenium IDE after you have closed and reopened the webpage? 2. Try to install and investigate the problem with Firebug Addon – Dmytro Zharii Jun 28 '12 at 19:22
What's the xpath given by Firebug or any other html debugger? – Suchit Parikh Sep 27 '12 at 16:40

Try using this:

share|improve this answer

As per my understanding, I am listing down the below resolutions:

  1. Try to use more specific and short XPath using @id, @class, etc. for the HTML elements.
  2. Use click() instead clickAt().
  3. Use mouseDown() instead of clickAt() - Sometimes this works.

Try with all the above 3 options.

share|improve this answer

You can change the xpath to xpath=//html/body/div/div[2]/ul/li[3]. Also, sometimes the IDE records the xpath but while using them in RC script you will get an error. It's best to use XPather to get the xpath or geting the xpath using Firebug will do good too.

Note: IE sometimes gives problem with xpath. So please try to keep this as your last option.

share|improve this answer

Am i correct in thinking that you have to hover over the menu to see the other elements? If so, the XPath will never work if the elements aren't visible.

Use Actions to perform a hover over the menu item and after that, execute the xpath expression. That should work.

share|improve this answer

protected by user246 Dec 26 '12 at 22:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.