来自 selenium 网站的经典谷歌测试,它适用于 vista 上的 FF。在 IE7 上,显然没有找到 window 对象。当我将配置更改为使用“*iexploreproxy”(而不是“*iexplore”)时,Selnm 在测试(在 IE 上)中走得更远,但我不能使用它,因为它会导致不受信任的安全证书警告。我安装了 selenium RC 1.0.1,并检查了它是否在我的盒子上运行,我没有使用任何其他工具,例如溴。我在 Eclipse 上运行。
公共类 NewTest 扩展 SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://www.google.com/", "iexplore");
// We instantiate and start the browser
}
public void testNew() throws Exception {
selenium.open("/");
selenium.type("q", "selenium rc");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
if(! selenium.isTextPresent("Results * for selenium rc"))
throw new Exception("failed");
}
}