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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.