0
我在web應用程序測試中使用assertTrue
聲明,即使文本存在於Web中也返回false。我怎樣才能解決這個問題?Selenium RC - 在我的測試腳本出現後出現空指針異常
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");
}
}