I am attempting to set up some UI testing in Watir for our web application. I'm running into trouble getting the click events to propagate. We are using EXTJS to make tabs, which are spans in the resulting html.
If I select a span like this it works:
span1 = @browswer.span(:text=>"Tab Name")
span1.click
The trouble is when I have a subtab with the same name and want to be able to differentiate them. The only way I've found to select the subtab explicitly is to first select the list that the subtab is in, and then select the subtab from that.
ul = @browser.ul(:class=>/tab-strip-bottom/)
span2 = ul.span(:text=>"Tab Name")
span2.click
span2.click doesn't appear to do anything. The only different (I can see) between span1 and span2 is the container attribute. span1.@container = @browser, span2.@container = ul.
I tried setting the container on span2 with
span2.instance_variable_set("@container", @browser)
but then I wind up clicking on the wrong tab anyway. Any thoughts on this? Thanks!