11 September 2012

Got IE working with WATIR/Cucumber and AJAX

My code for this, is up on github.com:
https://github.com/wbwarnerb/cucumber-demo

I had some issues getting IE working with WATIR/Cucumber, but they were resolved recently.  Really it didn't take a lot to resolve it.  What was happening, were two problems, causing one error.

The error read from Cucumber something about Selenium not finding the window/browser.

I did some googleing and found out that Cucumber needs to have IE to have the same security settings in each zone.  So I did that.  But I still got the error....

That's when I simply added a wait for an element to load.  Here's an example:
  @browser = Watir::Browser.new(:ie)
  @browser.goto "http://www.amazon.com"
  @browser.text_field(:name => "field-keywords").wait_until_present(10)

While Firefox doesn't need that "wait_until_present", IE did require it.  Once I passed that in and waited, it allowed IE to run the test with Amazon.com, finding the first element. 

No comments:

Post a Comment