简体   繁体   English

运行行为测试用例时,URL异常格式

[英]Malformed url Exception while running behavioural test cases

I am trying to access a web page url from my behavioural test case. 我正在尝试从我的行为测试用例访问网页URL。 The following piece of code is used for it: 使用以下代码:

@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());
}

This when run after the application is deployed on to the server, throws the following exception: 在将应用程序部署到服务器后运行此脚本时,将引发以下异常:

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;

I am able to access the page from the browser though. 我可以从浏览器访问该页面。 Have been stuck up with this for a while. 已经坚持了一段时间。 Any ideas? 有任何想法吗?

Solved it by commenting the following in my header jsp file: 通过在我的头文件jsp文件中注释以下内容来解决该问题:

META HTTP-EQUIV="Refresh" CONTENT="3600" META HTTP-EQUIV =“刷新” CONTENT =“ 3600”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM