I am trying to run webdriver tests on IE. My script works on Firefox but not on IE9. I am using selenium-webdriver version 2.5.0 with ruby 1.8.7 patch level 352
He开发者_JAVA技巧re is my ruby script:
require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :ie
driver.navigate.to "http://www.gapinc.com/"
element = driver.find_element(:name, 'search')
element.send_keys 'Employees'
element.submit
puts driver.title
driver.quit
On IE9, I get Unable to find element with name == search (Selenium::WebDriver::Error::NoSuchElementError) and it passes on Firefox
It may be sync issue. Did you try using ImplicitlyWait or WebDriverWait?
精彩评论