selenium.open("/"); generated an XHR 500: Internal Server Error [closed]
Any clues on what causes this?
This is a known issue in Selenium RC 1.0.3. Details can be found here: http://code.google.com/p/selenium/issues/detail?id=408
The workaround for 1.0.3 is to overload the open
command with one that passes a boolean as a second argument set to true
.
Alternatively, you could wait for a new version to be released, however most development efforts are focused on Selenium 2. This is currently in alpha, and the latest version (2.0a4) does not have this issue.
This one worked for me in Java.
If a URL(say testurl) brings up the XHR Response code 500 Internal server error, then dont use the selenium.open command to open the url. instead, try with selenium.openWindow
. Something like this:
selenium.open("http://google.com"); //or any site that will open without an error
selenium.openWindow(testurl,"18");
selenium.selectWindow("18");
selenium.selectWindow("Google"); //or the window title of the site from step 1 above
selenium.close();
selenium.selectWindow("18");
Thanks. Got the solution..For any other people who chance upon this problem, here is the solution:
Replace setUp(...)
with
Integer port = 4444;
String browserString= "*firefox";
String url = "http://yoururl.com";
selenium = new DefaultSelenium("localhost",port,browserString,url) {
public void open(String url) { commandProcessor.doCommand("open", new String[] {url,"true"});};
selenium.start();
精彩评论