softqa wrote:Can eValid wait until "loading" my JavaScript passages has finished? Is there where you use your SyncNot...commands?
That's a good question, and we see this more and more with complex AJAX applications (think, for example, of GWT): The recording is perfect and plays back normally but when the server is particularly slow the playback gets out of synchronization because there's nothing in the script to account for background download of JavaScript.
eValid's synchronization modes offer a couple of routes for this:
(1) Assuming that the JavaScript fully loaded in the page, then use the PageMap to find the largest numbered page element. In most cases the JavaScript references are at the bottom of the page, so you know that if these high-numbered page elements (large sourceIndex values) are loaded then you know that the JavaScript is fully present.
Then it is simply a matter of using a SyncOnProperty-type command to confirm that that element is present to know that the page is fully loaded.
We've used this in a number of situations, in GWT applications as well as in some other types of implementations, with very good effect.
(2) Again, wait until the page is stabilized and try to find some visible element of the page that shows the word "Loading..." -- this is a very nice gesture by the JavaScript so that you don't try to act on the page before all of what is supposed to be there actually is there.
While the pages shows "Loading..." find the sourceIndex of "Loading..."
and the use a SyncNot command in eValid to achieve the synchronization. The SyncNot commands are the logical inverse of the Sync commands, but instead of waiting until something is true they wait until something is NOT true, before continuing.
In this case, you're waiting until the "Loading..." message goes away before
continuing.
(There is a risk that "Loading..." may disappear and the loading is not finished. This might happen if the programmer who put the "Loading..." in there in the first place is playing games with you. In that case, not even eValid will be smart enought to anticipate what might be going on.)
Hope this is helpful.
The eValid Support Team