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 [email protected].
To post to this group, send email to [email protected].
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.