06 September 2012

Watir Wait_Until_Present

In getting IE9 working with my cucumber framework, I figured out the problem.  IE9 was throwing errors of "can't find window" or "can't find driver" each time I ran the test.  After kicking it around a few times I tried a solution to wait for the element.  That seemed to be the solution.

We did this in GEB, where I work - using waitFor's.

 In Watir, it's like this:
@browser.text_field(:name => "field-keywords").wait_until_present(10)

basically it's saying wait for the text field named "field-keywords" for up to 10 seconds.

Right now I'm doing with Watir, and Cucumber what GEB hasn't got working in 2 years at the office - simply being cross browser compatible.  GEB has a hard time even closing the IE sessions... Watir and Cucumber make it so easy.

 

No comments:

Post a Comment