以下命令點擊鏈接殺死測試
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)
感謝您的建議redrah – user515867 2010-11-22 14:07:37
剛發現打開的彈出窗口是模態對話框 – user515867 2010-11-23 08:50:29