Selenium failure on selenium.click (xpath with checkbox) from java rc running from testng and maven

55 views
Skip to first unread message

Drahcir

unread,
Dec 16, 2008, 8:07:23 AM12/16/08
to selenium-users...@googlegroups.com
Hi all,

The following code fails within Remote control with *iexplore on the blue line. I have searched the forum and the FAQ's, but couldn't find anything related to this issue. We are running the tests from maven 2 with testng, although direct run from Eclipse and testng fails as well. It looks like there is a problem with click in combination with XPath and checkbox (the rest of the xpath related commands don't have issues).
We are using selenium-remote-control 1.0-beta1.

{font:style=font-family: courier new,courier; font-size: 8pt;}   public void testNoSlaveSelected() throws Exception { \\         selenium.open(getPath());{font}

{font:style=font-family: courier new,courier; font-size: 8pt;}        selectUseCase(); \\         Assert.assertTrue(selenium.isElementPresent("//h4[contains(text(), 'Test cases of Use case 1')]")); \\         {font:style=color: #0000ff;}selenium.click("//tr[td[contains(text(), \"Ping Project\")]]/td/input[@type='checkbox']");{font} \\         selenium.click("//tr[td[contains(text(), \"Ping Project Revisited\")]]/td/input[@type='checkbox']");{font}

{font:style=font-family: courier new,courier; font-size: 8pt;}        selenium.click("//tr[td[contains(text(), \"Internet Explorer 6.0\")]]/td/input[@type='checkbox']"); \\         selenium.click("//tr[td[contains(text(), \"Firefox 3.0\")]]/td/input[@type='checkbox']");{font}

{font:style=font-family: courier new,courier; font-size: 8pt;}        selenium.click("//span[contains(text(), \"Start Test Run!\")]/../../");{font}

{font:style=font-family: courier new,courier; font-size: 8pt;}        waitForText("At least one groundcontrol slave should be selected."); \\     }{font}
{font:style=font-family: courier new,courier; font-size: 8pt;}   private void selectUseCase() { \\         Assert.assertTrue(selenium.isElementPresent("//span[contains(text(), \"Projects\")]")); \\         selenium.click("//span[contains(text(), \"Projects\")]/"); \\         Assert.assertTrue(selenium.isElementPresent("//td[contains(text(), 'GroundControl')]")); \\         selenium.click("//span[contains(text(), \"Projects\")]/../../img"); \\         Assert.assertTrue(selenium.isElementPresent("//span[contains(text(), \"GroundControl\")]")); \\         selenium.click("//span[contains(text(),  'GroundControl')]/"); \\         Assert.assertTrue(selenium.isElementPresent("//h4[contains(text(), 'Environments of GroundControl')]")); \\         selenium.click("//span[contains(text(), \"GroundControl\")]/../../img"); \\         Assert.assertTrue(selenium.isElementPresent("//span[contains(text(), \"prod\")]")); \\         selenium.click("//span[contains(text(),  'prod')]/"); \\         Assert.assertTrue(selenium.isElementPresent("//h4[contains(text(), 'Use cases of')]")); \\         selenium.click("//span[contains(text(), \"prod\")]/../../img"); \\         Assert.assertTrue(selenium.isElementPresent("//span[contains(text(), \"Use case 1\")]")); \\         selenium.click("//span[contains(text(),  'Use case 1')]/"); \\     }{font}

* \\*
This is the stack trace
{font:style=font-family: courier new,courier; font-size: 8pt;}![CDATA[com.thoughtworks.selenium.SeleniumException: ERROR: Selenium failure. Please report to the Selenium Users forum at http://forums.openqa.org, with error details from the log window.  The error message is: Unspecified error. \\     at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:90) \\     at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:84) \\     at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:166) \\ {font:style=color: #0000ff;}    at nl.qnh.groundcontrol.RunTestFromUseCaseSelection.testNoBrowserSelected(RunTestFromUseCaseSelection.java:56){font} \\     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) \\     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) \\     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) \\     at java.lang.reflect.Method.invoke(Method.java:597) \\     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) \\     at org.testng.internal.Invoker.invokeMethod(Invoker.java:478) \\     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617) \\     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885) \\     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) \\     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110) \\     at org.testng.TestRunner.runWorkers(TestRunner.java:712) \\     at org.testng.TestRunner.privateRun(TestRunner.java:582) \\     at org.testng.TestRunner.run(TestRunner.java:477) \\     at org.testng.SuiteRunner.runTest(SuiteRunner.java:324) \\     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319) \\     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292) \\     at org.testng.SuiteRunner.run(SuiteRunner.java:198) \\     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821) \\     at org.testng.TestNG.runSuitesLocally(TestNG.java:788) \\     at org.testng.TestNG.run(TestNG.java:708) \\     at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74) \\     at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92) \\     at org.apache.maven.surefire.Surefire.run(Surefire.java:177) \\     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) \\     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) \\     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) \\     at java.lang.reflect.Method.invoke(Method.java:597) \\     at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) \\     at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) \\ ]]>{font}

The code in HttpCommandProcessor shows the following:
{font:style=font-family: courier new,courier; font-size: 8pt;}    public String doCommand(String commandName, String[] args) { \\         DefaultRemoteCommand command = new DefaultRemoteCommand(commandName,args); \\         String result = executeCommandOnServlet(command.getCommandURLString()); \\         if (result == null) { \\             throw new NullPointerException("Selenium Bug! result must not be null"); \\         } \\         if (!result.startsWith("OK")) { \\             return throwAssertionFailureExceptionOrError(result); \\         } \\         return result; \\     }{font}

My conclusion is that the result of the result doesn't start with OK. But I don't know how to further investigate this.

Clicking on checkboxes with the same XPath's runs fine.


Any help appreciated.

cheers,

Richard.

Drahcir

unread,
Dec 17, 2008, 4:19:56 AM12/17/08
to selenium-users...@googlegroups.com
Hi Andras,

We experience the same problem with the latest snapshot.

Richard.

Drahcir

unread,
Dec 18, 2008, 9:30:45 AM12/18/08
to selenium-users...@googlegroups.com
It results in the same problem in IE. Note that we don't have an issue
on Ubuntu running Firefox.

I guess it makes sense to play around with the xpath then? I will let
you know if I fixed it.

thanks for the help,

Richard.

Drahcir

unread,
Dec 19, 2008, 9:10:44 AM12/19/08
to selenium-users...@googlegroups.com
Nope, this fails as well.

Himanshu Rawat

unread,
Apr 22, 2009, 4:24:02 AM4/22/09
to selenium-users...@googlegroups.com
Hi All,

I am getting exactly same exception. Is it resolved?

I am doing below things.

1) Opening a page in new window -->  successfully opens
2) Selects a radio button             --> selects

After selecting a radio button, just below it two text boxes appears which i don't use.

And then i m suppose to click on submit button.

Do u think its giving exception because of two text boxes that comes on selecting radio button??

From logs ( in debug mode) i see that it's not able to retreieve the commandQueue...


Anyone knows how to solve?


Himanshu Rawat

Reply all
Reply to author
Forward
0 new messages