[Seaside] WebTester Locator Argument Accessor

Joel Turnbull joelbywan at gmail.com
Sat Mar 5 18:39:29 UTC 2011


Yes, Andrei's solution gives me the same behavior I was getting before.

i.e. If I have a link that does some jquery, and makes a div appear.

jqueryLink click.
self pause: '5000'.
self assert: (self divByXPath: '//div...' ) isPresent.

Seems the pause is actually getting triggered before the jquery click has a
chance to change the dom. So the click happens, there is a pause, the div
appears and the assert is called too quickly to find it ( I think ).

Indeed, my problem really boils down to the default timeout value slowing
down my test suite, so I think calling selenium setTimeout is the right
approach. Doing that with a significantly reduced value seems to be doing
the trick.

Thanks all,
Joel



On Fri, Mar 4, 2011 at 5:39 AM, Avi Shefi <avishefi at gmail.com> wrote:

> Sounds like this solution will make most browsers hang.. Why not use a
> setTimeout ?
> Reading your question, it's clear that the reason you use waitForCondition
> in the first place is to detect the existence of an element. So why doesn't
> waitForCondition suffice? In the case you want to cascade the assertions,
> you can just do a waitForCondition that combines both assertions (checking
> that an element exists, and also checking its value).
>
> Avi.
>
> On Fri, Mar 4, 2011 at 12:03 PM, Andrei Vasile Chis <
> chisvasileandrei at gmail.com> wrote:
>
>> Hi Joel,
>>
>> A very simple way (and perhaps not the best way) in which you could obtain
>>  just a delay is to simply execute a time - comparison loop. You don't have
>> to execute it inside a waitForCondition block. For example you could
>> extend WebTester with the following methods and then in your test just call
>> "self webTester pause: 10000" and then verify your condition using the
>> WtWebTester api.
>>
>> WtWebTester>>getEval: aScript
>> self subclassResponsibility
>>
>> WtWebTester>>pause: waitTimeInMillis
>>        self subclassResponsibility
>>
>> WtSeleniumWebTester >>getEval: aScript
>>  ^ self processCommand: 'getEval' withParams: (Array with: aScript).
>>
>> WtSeleniumWebTester >>pause: waitTimeInMillis
>>  self getEval: 'var date = new Date(); var curDate = null;  while
>> (curDate = new Date() - date < ', waitTimeInMillis asString, '){} '.
>>
>>
>>
>> My 2cents
>>
>> Andrei
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110305/db8982e7/attachment.htm


More information about the seaside mailing list