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.