Java: Throw SeleniumException in selenium.isTextPresent("text");

7 views
Skip to first unread message

Paulo Cheque

unread,
Jul 21, 2006, 10:59:38 AM7/21/06
to selenium-users...@googlegroups.com
Selenium-RC v0.8.1 / Firefox

I try this code "if (selenium.isTextPresent("myText"); { ... } else { ... }" and *sometimes* this throws an exception 'SeleniumException'.

I don't put "assertTrue(isTextPresent)"...........

This code isn't in a test, it is in a setUpOnce.

*Exception:*
_____________________________________________________________________________
com.thoughtworks.selenium.SeleniumException: ERROR: Page text not found
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:73)
at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:150)
at com.thoughtworks.selenium.HttpCommandProcessor.getBoolean(HttpCommandProcessor.java:205)
at com.thoughtworks.selenium.DefaultSelenium.isTextPresent(DefaultSelenium.java:270)
at selenium.SeleniumTestCase.fazerLogin(SeleniumTestCase.java:93)
at selenium.SeleniumTestCase.access$1(SeleniumTestCase.java:87)
at selenium.SeleniumTestCase$1.setUp(SeleniumTestCase.java:46)
at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.extensions.TestSetup.run(TestSetup.java:23)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)

_____________________________________________________________________________

Thanks in advance.
Paulo

Message was edited by:
paulocheque

Paulo Cheque

unread,
Jul 21, 2006, 11:46:47 AM7/21/06
to selenium-users...@googlegroups.com
I saw in HttpCommandProcessor of Java-Client-Driver:

______________________________________________________________
public String doCommand(String commandName, String[] args) {
DefaultSeleneseCommand command = new DefaultSeleneseCommand(commandName,args);
String result = executeCommandOnServlet(command.getCommandURLString());
if (result == null) {
throw new NullPointerException("Selenium Bug! result must not be null");
}*
if (!result.startsWith("OK")) {
throw new SeleniumException(result);
}*
return result;
}
______________________________________________________________

My command return "ERROR: Page text not found".


=(


Thanks in advance
Paulo

Paulo Cheque

unread,
Jul 21, 2006, 12:27:58 PM7/21/06
to selenium-users...@googlegroups.com
Yes, you are right, there is no page loaded =(
My waitForCondition is not working properly.

Thanks.

Reply all
Reply to author
Forward
0 new messages