Using console with Selenium Webdriver.Chrome () throws exceptions
I am using Ubuntu 12.04 with Selenium webdriver 2.38.4, Chromium 37.0 and chromedriver 2.10. I am running a basic script:
chrome_options = Options()
driver = webdriver.Chrome(chrome_options=chrome_options,
executable_path='/usr/bin/chromedriver')
driver.get('http://www.google.com')
Once I start looking around at the Chrome console, the next set of commands I'm trying to execute (driver.title, driver.find_element_by_tag_name('body') )
looks like this:
WebDriverException: Message: u "unknown error: Runtime.evaluate threw exception: TypeError: Cannot read property 'click' null \ n (session info: chrome = 37.0.2062.94) \ n (Driver info: chromedriver = 2.10.267517, platform = Linux 3.5.0-45-generic x86)
Does anyone know why this is happening? Its kind of hard rebooting every time just to keep it working properly.
source to share
Maybe (or can't!) Help, but when I had this error for other elements, I got around it by giving the element that I am looking for a name and id.
Not suitable for body tag, however if that means you can run tests.
I assume, of course, that you are testing something that you can change.
source to share