Yes, this makes sense from the code perspective. What your site is doing is requiring you to accept an alert, then it does some kind of processing, then it refreshes some/all of the page.
Your code is trying to click the element before the refresh has happened, and because of the way you are rescuing it, it is giving you misleading information. The element was located but couldn't be used, then at the point it is trying to be used it is stale, and that method isn't relocating when stale. Can you raise an issue on Github with this gist? Something like "Watir should relocate stale elements when trying to click them" In the meantime, something like this should work: @b.alert.ok @b.div(id: "spinnerOverlay").wait_while(&:present?) @b.button(id: "NavContinue").click On Tue, Nov 6, 2018 at 10:56 AM <[email protected]> wrote: > > Hi Titus, > > Here is the gist url > > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de > > -- > -- > Before posting, please read > https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. > In short: search before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > --- > You received this message because you are subscribed to the Google Groups > "Watir General" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
