Hmm, it should be really difficult to get that exception in watir. Can you provide a stack trace?
On Wed, Oct 3, 2018, 3:41 AM 'gary' via Watir General < [email protected]> wrote: > hi, > > I'm having trouble converting some selenium scripts to watir, lol please > don't ask me why, anyway, the basic selenium script below works a treat: > > require 'selenium-webdriver' > $b=Selenium::WebDriver.for :chrome > $b.get'mywebsite' > # click cookie message overlay > sleep(3) > $b.find_element(:xpath=>"//*[@id='continue']").click > puts $b.execute_script("return dataLayer;") > > > the watir equivalent appears to fail: > > require 'watir' > $b = Watir::Browser.new :chrome > $b.goto('mywebsite') > # click cookie message overlay > sleep(3) > $b.link(id: 'continue').click > puts $b.execute_script("return dataLayer;") > > returning the following error: > > stale element reference: element is not attached to the page document > (Selenium::WebDriver::Error::StaleElementReferenceError) > > > does anyone know of a workaround for this or any ideas as to how to > extract the relevant data? > > Regards, > > G > > -- > -- > 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.
