|
Re: ajax, rich text areas and frames: msg#00046web.selenium.user
D. Woodill wrote: --- Robin Becker <robin-EZnAFvyyu2tF6kxbq+BtvQ@xxxxxxxxxxxxxxxx> wrote:.... certainly the patch that does the timeout can be triggered by any suitable event. For an automatic test the button pusher isn't available. The problem of causing the wait to 'fail' is still there anyhow. I added this to TestLoop this.setPollTimeout =function(t){ if(t){ this.pollTimeout = window.setTimeout("testLoop.checkPollTimeout()", t); } } this.checkPollTimeout=function(){ if(this.waitForCondition){ this.waitForCondition = function(){return true;} } } and then changed pollUntilConditionIsTrue to look like /** * Busy wait for waitForCondition() to become true, and then continue command execution. */ this.pollUntilConditionIsTrue = function () { if (this.waitForCondition()) { if(this.pollTimeout){ window.clearTimeout(this.pollTimeout); this.pollTimeout = null; } this.waitForCondition = null; this.continueCommandExecutionWithDelay(); } else { window.setTimeout("testLoop.pollUntilConditionIsTrue()", 10); } }; so the timing out is fairly easy with an explicit setTimeOut call on the testloop. It's fairly easy to generalize things to allow for a default timeout value for all waits. Also it seems harder to get the fact that the timeout occurred into pollUntilConditionIsTrue; I suppose we could set a value onto the testloop inside checkPollTimeout and return it if available in pollUntilConditionIsTrue. Assuming that we can get that information into the return value of pollUntilConditionIsTrue what should be done with it to indicate the wait failed? -- Robin Becker |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: ajax, rich text areas and frames: 00046, D. Woodill |
|---|---|
| Next by Date: | selecting text right after a radio button using xpath: 00046, Hamilton Chua |
| Previous by Thread: | Re: ajax, rich text areas and framesi: 00046, D. Woodill |
| Next by Thread: | selecting text right after a radio button using xpath: 00046, Hamilton Chua |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |