Selenium RC test - IE gives 403 error on Tomcat app, Tomcat root OK

Posted by Ed Daniel on Stack Overflow See other posts from Stack Overflow or by Ed Daniel
Published on 2010-05-11T16:52:47Z Indexed on 2010/05/17 15:50 UTC
Read the original article Hit count: 508

I'm new to Selenium RC, having previously used Selenium IDE and only run tests in Firefox. I'm trying to get a basic test to run using Selenium RC through Eclipse; my test works OK in Firefox, and in Safari now that I've killed the pop-up blocker, but IE8 is causing a SeleniumException to be thrown, containing an "XHR ERROR" with a 403 response:

com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://localhost:8080/pims Response_Code = 403 Error_Message = Forbidden
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335)
    at org.pimslims.seleniumtest.FirstTest.testNew(FirstTest.java:32)
    ...

I can do a similar test on http:/ /localhost:8080 (space between the slashes here because SO thinks I'm spamming) and it's fine - I can make IE open that Tomcat default page and click a link. It's only if I try to open my application at http:/ /localhost:8080/pims that I see this error - and only in IE. I can open that URL in IE by typing it into the address bar.

I was convinced that there's some setting in IE that's causing this, but I've tried everything I can think of. http:/ /localhost:8080 is in my Trusted Sites, and I've turned the security for that zone down to the minimum, allowed anything that looks related to popups, etc. If I try adding http:/ /localhost:8080/pims/ to Trusted Sites, IE says it's already there.

I've also messed around with proxy settings, to no avail, but may have missed something obvious.

I've tried starting the test with *iexplore, *iehta, and *iexploreproxy - all behave the same.

Is there something I've missed?

For reference, here is my test case - this works as is, in Firefox, opening the PIMS application's index page and clicking a link:

public class FirstTest extends SeleneseTestCase {
    @Override
    public void setUp() throws Exception {
        this.setUp("http://localhost:8080/", "*firefox");
    }

    public void testNew() throws Exception {
        final Selenium s = this.selenium;
        s.open("/pims");
        s.click("logInOutLink");
        s.waitForPageToLoad("30000");
    }
}

Any help is greatly appreciated!

© Stack Overflow or respective owner

Related posts about ie

Related posts about selenium-rc