Yes, it does not make sense to wait for an asynchronous action. ;-)
-- 
Alexander Kriegisch


> Am 08.08.2017 um 21:10 schrieb Mark <mark.eric...@gmail.com>:
> 
> Thanks for the help!   You waitFor() approach which also confirms the 
> expected page is loaded is great!
> 
> I had previously tried someone else's suggestion, which didn't help, which 
> was to wrap the click in a waitFor
> 
> waitFor { next[0].click() }
> 
> 
>> On Tuesday, August 8, 2017 at 3:38:12 AM UTC-4, Alexander Kriegisch wrote:
>> You are having a timing issue. 'next[0].click()' is an asynchronous action 
>> changing the page content. You should use 'waitFor' in order to make sure 
>> that the page was actually updated as expected, e.g. like this: 
>> 
>> go "https://www.uline.com/Product/GuidedNav?t=184360&dup=over"; // direct to 
>> Shipping Boxes 
>> assert title == 'ULINE - Shipping Boxes' 
>> def currentPage = 1 
>> while (true) { 
>>   waitFor { $("span.GNPaging 
>> a.DisabledLink")*.text().contains(currentPage.toString()) } 
>>   def table = $('table.GNItemTable') 
>>   assert table != null && table.size() > 0 
>>   def theader = table.$('thead tr th') 
>>   def next = $('a.EnabledLink', text: 'Next>') 
>>   if (next == null || next.size() == 0) break 
>>   next[0].click() 
>>   currentPage++ 
>> } 
>> 
>> For me this works and fixes the problem. 
>> -- 
>> Alexander Kriegisch 
>> https://scrum-master.de 
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to geb-user+unsubscr...@googlegroups.com.
> To post to this group, send email to geb-user@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/geb-user/972bedce-c388-40db-ab4f-b5708c33f6a6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to geb-user+unsubscr...@googlegroups.com.
To post to this group, send email to geb-user@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/97917CFC-8C44-404F-A036-6277C5AF68A4%40kriegisch.name.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to