Hi Jon,
Take a look on this thread : http://forums.openqa.org/message.jspa?messageID=6345
Selenium provide a method named "waitForPageToLoad", that is implicitly called after open(), but not after click(). The problem is it is impossible to know if the "click" make a page to load or not. And if you call "waitForPageToLoad" and no page is actually loading, the call wait until timeout and raise an exception.
Perhaps we could use this ugly trick :
public void click(...) {
selenium.click(...);
try {
waitForPageToLoad(5?);
} catch (SeleniumException e) {
// Do nothing, supposing no page is loading
}
}
++
Julien
----- Message d'origine ----
De : Jon Frisby <[EMAIL PROTECTED]>
À : [EMAIL PROTECTED]; [EMAIL PROTECTED]
Envoyé le : Mercredi, 7 Juin 2006, 2h20mn 23s
Objet : Another Selenium fix...
Can you tell me what the expected behavior of setFormParameter is?
For the moment I have it delegate to setTextField, but I suspect that
that's wrong behavior (thus it's not included in my patch)...
-JF
Take a look on this thread : http://forums.openqa.org/message.jspa?messageID=6345
Selenium provide a method named "waitForPageToLoad", that is implicitly called after open(), but not after click(). The problem is it is impossible to know if the "click" make a page to load or not. And if you call "waitForPageToLoad" and no page is actually loading, the call wait until timeout and raise an exception.
Perhaps we could use this ugly trick :
public void click(...) {
selenium.click(...);
try {
waitForPageToLoad(5?);
} catch (SeleniumException e) {
// Do nothing, supposing no page is loading
}
}
++
Julien
----- Message d'origine ----
De : Jon Frisby <[EMAIL PROTECTED]>
À : [EMAIL PROTECTED]; [EMAIL PROTECTED]
Envoyé le : Mercredi, 7 Juin 2006, 2h20mn 23s
Objet : Another Selenium fix...
This patch compensates for the fact that the Selenium client library
doesn't actually wait for the page to finish loading when you do an
open() or click(). This was resulting in me having to add
Thread.sleep(some_way_too_large_number) in my tests for things to work.
doesn't actually wait for the page to finish loading when you do an
open() or click(). This was resulting in me having to add
Thread.sleep(some_way_too_large_number) in my tests for things to work.
Can you tell me what the expected behavior of setFormParameter is?
For the moment I have it delegate to setTextField, but I suspect that
that's wrong behavior (thus it's not included in my patch)...
-JF
_______________________________________________ Jwebunit-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jwebunit-development
