Selenium, Java, waitForCondition

I want to check the following (on ie8):

After clicking the link, a popup window opens, after which I want to check whether the contents of the flash memory are loaded inside.

For some reason, waitForPopUp does not work, it just waits and expires, but I solved it like this:

selenium.waitForCondition("selenium.getAllWindowTitles().length > 1;", "30000"); String windowID = selenium.getAllWindowTitles()[1]; selenium.selectWindow(windowID); 

Then I want to check if the flash content exists before checking anything on it (the web page is very slow and the popup takes some time to show something)

 selenium.waitForCondition("selenium.isElementPresent(\"//*[@id='flashcontent']\");", "30000"); FlashSelenium flashApp = new FlashSelenium(selenium, "flashClient"); assertTrue ( flashApp.PercentLoaded() == 100 ); 

I tried hundreds of ways to do this, but no one works, I also tried to check if the text is present, but nothing will always fail, even if the web page is fully loaded.

For some reason, everything works fine if I do it step by step in the debugger: S

+4
source share
1 answer

I thought a little.
It is not possible to test an object if it is really loaded, and the flash application is ready and initialized.
The only true way to let selenium know that a flash object is loaded and ready to use flash memory for the ExternalInterface method, and call a JavaScript function that assigns var and then runs a var selenium timer test.

 Example<br/> // in JavaScript var isFlashLoaded = false; function cbIsLoaded( ){ isFlashLoaded = true; } // in AS3 var retVal:int = ExternalInterface.call("cbIsLoaded"); 
+1
source

All Articles