开发者

Why does this not work on IE9 but works on Firefox?

开发者 https://www.devze.com 2023-04-04 21:18 出处:网络
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

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号