Ok. It wasn't actually giving HTTP 500 for the verifyTextPresent
command--that was some other temporal problem that I can't seem to
reproduce anymore. It's just getting "Page text not found" from the
server. Digging into the JavaScript, I see that this message indicates
that the *whole* page text is an empty string while I had assumed that
it just can't find my specific string (maybe change the error message
into "Page text was empty" instead?).

Any idea why the following function would fail with "Page text not
found" even though I can clearly see the correct HTML page in the
Selenium browser frame?

Selenium.prototype.assertTextPresent = function(expectedText) {
    // this translates to browserbot.getCurrentPage().bodyText() 
    // which returns an empty string:
    var allText = this.page().bodyText();

    if(allText == "") {
        assert.fail("Page text not found");
    } else if(allText.indexOf(expectedText) == -1) {
        assert.fail("'" + expectedText + "' not found in page text.");
    }
};

In general, is anyone on the list using Selenium on Linux? If so, I'd
be more than happy to hear about your particular setup.

Thanks.


-Lasse-

On 8/16/05, Lasse Koskela <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> We've been using Selenium TestRunner for some time and are now looking
> into migrating to the driven mode since writing those HTML tests
> really isn't that delightful.
> 
> Now we're in a point where we have a JUnit test suite that deploys our
> application on Tomcat (launched with Selenium's OutbeddedTomcat
> class), launches Mozilla (on Linux), and manages to access the front
> page (login page) of the application as well as actually log in. The
> problem is that after executing the Selenese command
> "|clickAndWait|submitLogin||", the next "|verifyTextPresent|Foo||"
> always fails even though we can clearly see the text "Foo" in
> Selenium's browser frame.
> 
> I hacked a couple of System.out.println's into the Selenium driver
> (we're using Java as you may have guessed from us deploying on Tomcat)
> and found out that the server is responding with "HTTP 500 Internal
> Server Error" when the test polls the URL
> "http://localhost:8080/selenium-driver/driver?commandRequest=|verifyTextPresent|Foo||"
> 
> So, my question is how to go about debugging what's happening on the
> server side?
> 
> -Lasse-
> 
> PS. I also got an HTTP 500 when trying the "pause" command so we're
> now sleeping with Thread.sleep() in order to let the application
> process requests etc.
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to