Selenium,Java,waitForCondition
•
Java
I want to check the following (on IE8):
After clicking the link, the pop-up window starts, and then I want to check whether the internal flash content has been loaded
For some reasons, waitforpopup does not work. It just waits and times out, but I have solved this problem:
selenium.waitForCondition("selenium.getAllWindowTitles().length > 1;","30000"); String windowID = selenium.getAllWindowTitles()[1]; selenium.selectWindow(windowID);
Then I want to check whether the flash content exists, and then check any content on it (the web page is very slow, and the pop-up window takes some time to display the content)
selenium.waitForCondition("selenium.isElementPresent(\"//*[@id='flashcontent']\");","30000"); FlashSelenium flashApp = new FlashSelenium(selenium,"flashClient"); assertTrue ( flashApp.PercentLoaded() == 100 );
I've tried hundreds of ways to do this, but there's no way. I've also tried to check whether the text exists but there's nothing. Even if the web page is fully loaded, it always times out
For some reason, if I step through the debugger, everything is fine: s
Solution
I thought more about it
Example<br/> // in JavaScript var isFlashLoaded = false; function cbIsLoaded( ){ isFlashLoaded = true; } // in AS3 var retVal:int = ExternalInterface.call("cbIsLoaded");
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码