我正在使用assertTrue
网络应用程序测试中的语句,即使文本存在于网络中,它也会返回错误。我怎样才能解决这个问题?
public void Test1() throws Exception {
Selenium selenium = new DefaultSelenium("localhost",1777,"*chrome","http://www.mortgagecalculator.org/");
selenium.start();
try {
selenium.open("/");
Thread.sleep(3000);
selenium.windowMaximize();
selenium.type("name=param[homevalue]", "400000");
selenium.type("name=param[principal]", "7888800");
selenium.select("name=param[rp]", "label=New Purchase");
selenium.type("name=param[interest_rate]", "8");
selenium.type("name=param[term]", "35");
selenium.select("name=param[start_month]", "label=May");
selenium.select("name=param[start_year]", "label=2006");
selenium.type("name=param[property_tax]", "7.5");
selenium.type("name=param[pmi]", "0.8");
selenium.click("css=input[type=\"submit\"]");
assertTrue(selenium.isTextPresent("$58,531.06"));
System.out.println("Assert Statement executed");
selenium.stop();
}
catch (Exception e) {
System.out.println("In Mortgage Calculator App exception Happened");
}
}