0 0

selenium 在IE上的问题3

我现在在用firefox和iexplore来做测试自动化。可现在编写的语言利用firefox时可以正常运行,利用ie的时候就不行。
请问哪位能够帮我解决以下。

内容如下,问题是 ie 执行 if((seleniumTest.isElementPresent("LoginUserID")) and (seleniumTest.isElementPresent("LoginPassword")))的时候直接执行了else里的内容。

if(CompareNoCase(URL.bor, "FF") eq 0) {
      seleniumTest = createobject("java","com.thoughtworks.selenium.DefaultSelenium").init("localhost", 4444, "firefox3","http://localhost");
} else {
seleniumTest = createobject("java","com.thoughtworks.selenium.DefaultSelenium").init("localhost", 4444, "*iexplore","http://localhost");
}
cfjunitObj   = createobject("component","net.sourceforge.cfunit.framework.TestCase");

seleniumTest.start();
seleniumTest.open("#URL.nxurl#");
seleniumTest.waitForPageToLoad("30000");

if((seleniumTest.isElementPresent("LoginUserID")) and (seleniumTest.isElementPresent("LoginPassword"))) {
    seleniumTest.type("LoginUserID", "#URL.initid#");
    seleniumTest.type("LoginPassword", "#URL.pass#");
    seleniumTest.click("LoginBtn");
    seleniumTest.waitForPageToLoad("30000");
} else {
    WriteOutput("#seleniumTest.isElementPresent("LoginUserID")#");
    WriteOutput("#seleniumTest.isElementPresent("LoginPassword")#");
    break;
}
2011年3月29日 09:56
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics