selenium.open( “/”);生成XHR 500:内部服务器错误

时间:2010-06-18 18:14:41

标签: java selenium

导致这种情况的任何线索?

3 个答案:

答案 0 :(得分:1)

这是Selenium RC 1.0.3中的一个已知问题。详情请见:http://code.google.com/p/selenium/issues/detail?id=408

1.0.3的解决方法是重载open命令,并将布尔值作为第二个参数设置为true

或者,您可以等待发布新版本,但大多数开发工作都集中在Selenium 2.目前处于alpha版本,最新版本(2.0a4)没有此问题。

答案 1 :(得分:1)

这个在Java中为我工作。 如果URL(比如testurl)显示XHR响应代码500内部服务器错误,则不要使用selenium.open命令打开该URL。相反,请尝试使用selenium.openWindow。像这样:

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");

答案 2 :(得分:0)

感谢。得到解决方案..对于遇到此问题的任何其他人,这里是解决方案:

setUp(...)替换为

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();
相关问题