Invalid Xpath 2 error for 'Click' selenium function

301 views
Skip to first unread message

Rick Reddy

unread,
Sep 3, 2013, 4:24:28 PM9/3/13
to seleniu...@googlegroups.com
Hello,

      I have ran a test using Selenium IDE 2.3.0 and copied the Junit4/Remote control script into the Eclispe Classic 4.2.2 and started running my code as 'Junit4'.

I see the following error:

Invalid Xpath 2

The selenium command in Eclipse for Xpath is:

selenium.click("//input[@value='Search Equipment']");

I tried copying the Xpath using Firebug which was:

/html/body/section[2]/section/div/div/div/form/div[2]/div[2]/div/span/input

But I get the same error.Can someone please help me on this. 

Note: I have tried using @type='submit' in xpath expression but still doesn't work. 

Rick Reddy

unread,
Sep 4, 2013, 1:42:20 PM9/4/13
to seleniu...@googlegroups.com
More Information: 

Tried with the XPath : selenium.click("//span[@id= 'rba-keyword-submit']") but still getting the same error. 
One thing I have noticed which may be useful for resolving this issue. The actual selenium IDE Command generated when recording is : "Command = 'ClickAndWait' and target = //input[@value='Search Equipment'] and nothing in the "value" field coz it is just a click functionality. But after, when I change the html version to Java/Junit4/Remote control the "ClickAndWait" command changes to Only "Click" in the Junit Remote control code. This may be causing the issue I guess. The wait command has been separated to the next line i.e. selenium.waitForPageToLoad("30000").

Rick Reddy

unread,
Sep 5, 2013, 7:02:32 PM9/5/13
to seleniu...@googlegroups.com
Did anyone try to resolve this Issue. I posted in many forums but no one is getting this. Please need some help :)

Julius Glifonea

unread,
Nov 11, 2013, 1:51:58 AM11/11/13
to seleniu...@googlegroups.com
I encoutered this error, and fixed it by downloading the latest .jar file of selenium-server in seleniumhq.org

Since my firefox version as of today, is Firefox 25.0, i think the .jar file needs update version.
Reply all
Reply to author
Forward
0 new messages