Does anyone know why this WebDriver function would be failing intermittently in Internet Explorer? Seems to always fail right around the textbox.clear()
line. It works perfectly in Firefox, but fails one in every few times in IE. Really frustrating. I'm using the latest Selenium (2.12?), IE 9 on Windows 7 with all Windows updates, Python 2.7.2.
http://dpaste.com/hold/661035/
def verify_find_hits(self, terms_hits, search_type):
""" verify that finding on a phrase gets expected number of hits """
self.browser.implicitly_wait(10)
for term, hits in terms_hits.items():
textbox = self.browser.find_element_by_id('query')
findb = self.browser.find_element_by_id('findbutton')
textbox.clear() # for when we loop and search more than once
textbox.send_keys(term)
findb.click()
util.wait_text_displayed(self, 'Privacy Policy')
if(search_type == 'int'):
if(hits == 0):
assert 'no results for your search' in self.browser.page_source
else:
assert str(hits) + ' total hits' in self.browser.page_source
else:
if(hits == True):
assert ' total hits' in self.browser.page_source
else:
assert 'no results for your search' in self.browser.page_source
WebDriverException: Message: 'Message: u\'Element must not be hidden, disabled or read-only\'
. So I am going to try putting in a check for enabled/visible just before the .clear()