Closed ghost closed 11 years ago
the Wait command basically waits until Webkit reports the pageFinished event. It might well be that your web page is not fully loaded, maybe there's a dangling HTTP request or something? It might also be that the page is already loaded if you call Wait, that's a more tricky case. Typically dryscrape is used for accessing remote pages, which don't load too quickly. Could also be that there is no page loading involved at all, that the button click merely executes some Javascript. In that case, you have no chance to get this right rather than waiting for some DOM change or just sleep
ing as you already do.
Unfortunately its the latter reason. I guess we will just have to put a sleep in there. Thanks for the timely response.
I have a scenario in which the user clicks a 'login' button, an ajax request is sent to the server and on success, they are redirected to the logged in homepage.
I am trying to write a test for this, with click(wait=True), however I'm not sure that the 'wait' will wait for the request to come back. If I include time.sleep(0.5), then the test passes, but otherwise it fails.
Is there an 'asyncronous mode' or am I doing something wrong?