[QA] suggestions for browser test debugging

Chris McMahon cmcmahon at wikimedia.org
Wed Nov 27 21:28:55 UTC 2013


On Tue, Nov 26, 2013 at 11:26 PM, S Page <spage at wikimedia.org> wrote:

> The Flow extension's features/flow_logged_in.feature fails for me
> asserting "Then links to talk and contrib should be visible" after "When I
> hover over the author link". I know exactly where it's failing, but not why.
>
> Whenever a test fails and it's not simply due to a page element changed
> its name or text, I have little idea how to debug it. SInce the cycle time
> for a test requiring login is over a minute, it's painful to try
> line-by-line changes. I'm used to interactively debugging jQuery selectors
> in a browser console, what's the equivalent for browser tests?
>

And here is the sophisticated answer.  Watir in particular (even before
Selenium existed) was always intended to be used interactively as well as
batch-wise.  The key is to use irb, interactive Ruby

$ irb
2.0.0p247 :001 > require 'watir-webdriver'
 => true
2.0.0p247 :002 > browser = Watir::Browser.new :firefox
 => #<Watir::Browser:0x..fac3245de232edb40 url="about:blank" title="">
2.0.0p247 :003 > browser.goto('
http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA')
 => "http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA"

at this point your browser has the Flow page open and you can zoom around
in it in some really spectacular ways.   A place to start looking is
https://github.com/watir/watir/wiki/Using-IRB, but there is a lot more
available.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20131127/01c319b0/attachment.html>


More information about the QA mailing list