格式错误的网址在运行行为测试用例时出现异常

时间:2012-11-10 06:36:38

标签: java html exception junit jbehave

我正在尝试从我的行为测试用例访问网页网址。以下代码用于:

@When("the user opens the sys admin login page of jset application")
public void openSysAdminLoginPage() throws Exception {
    htmlPage = webClient.getPage("http://localhost:8080/jset/login.jsp");

    assertEquals(200, htmlPage.getWebResponse().getStatusCode());
    assertEquals("OK", htmlPage.getWebResponse().getStatusMessage());
}

在将应用程序部署到服务器上运行时,会抛出以下异常:

When the user opens the sys admin login page of jset application
10 Nov 2012 11:45:04,636 [main]ERROR com.gargoylesoftware.htmlunit.html.HtmlPage 
Malformed refresh string (found ';' but no 'url='): 3600;

我可以从浏览器访问该页面。已经坚持了一段时间。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

通过在我的标头jsp文件中注释以下内容来解决它:

META HTTP-EQUIV =“刷新”内容=“3600”