以下命令
selenium.click("link=Identify Awards");
打开一个弹出窗口,但测试没有继续
我已放置
selenium.waitForPopUp(null, "1500");
selenium.windowFocus();
selenium.selectPopUp("Search -- Webpage Dialog");
在单击命令无济于事后,链接是转到一个java函数。
我知道这个命令点击链接、按钮、复选框或单选按钮。如果单击操作导致加载新页面(就像链接通常那样),请调用
waitForPageToLoad
. 我认为waitforPageToLoad
没有注册弹出加载
更新
我尝试了以下
selenium.fireEvent("link=Identify Awards", "onClick");
并得到以下
弹出窗口位于另一个域上,这可能是原因吗?
Exception in thread "Main Thread" org.openqa.selenium.ie.UnexpectedJavascriptExecutionException: Cannot execute script
System info: os.name: 'Windows Vista', os.arch: 'x86', os.version: '6.1', java.version: '1.5.0_12'
Driver info: driver.version: ie
at org.openqa.selenium.ie.ErrorHandler.verifyErrorCode(ErrorHandler.java:70)
at org.openqa.selenium.ie.InternetExplorerDriver.executeScript(InternetExplorerDriver.java:205)
at org.openqa.selenium.internal.seleniumemulation.JavascriptLibrary.callEmbeddedSelenium(JavascriptLibrary.java:47)
at org.openqa.selenium.internal.seleniumemulation.FireEvent.handleSeleneseCommand(FireEvent.java:35)
at org.openqa.selenium.internal.seleniumemulation.FireEvent.handleSeleneseCommand(FireEvent.java:1)
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:33)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:47)
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:277)
at org.openqa.selenium.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:209)
at com.thoughtworks.selenium.DefaultSelenium.fireEvent(DefaultSelenium.java:201)