It may be as simple as timing issue. What do you fingerprint to verify you logged in ok. You can use and .exists? present? visible? Typically after a click i follow up with a fingerprint assertion something like browser.span(:text,'Add a new Quick Event').wait_until_present(30)
BTW: When in doubt of whats happening you can add simple puts 'message here' in your code to assist your debug puts browser.span(:text,'Add a new Quick Event').exists Any reason browser.span(:text,'Add a new Quick Event).click isn't a solution? On Tuesday, September 2, 2014 7:03:53 PM UTC-5, David Karl wrote: > > I am investigating WATIR as a testing tool for a product that we are > developing for a client. At this stage I have my tests successfully opening > a browser, navigating to a page, entering text into the username and > password fields, clicking sign in and verifying that it is on the right > page. So in general, it is working well. > > However, the next thing that I am trying to do is click on a button to > begin a wizard. The element html is this: > > <a href="#" class="dialog btn btn-primary add-quick-event" > data-bind="click: addNewQuickEvent" data-dialog-url="[url here]"><span>Add > a new Quick Event</span></a> > > In the irb console the command WatirPageHelper.browser.link(:class => > "dialog btn btn-primary add-quick-event").flash causes the correct element > to flash. WatirPageHelper.browser.link(:class => "dialog btn btn-primary > add-quick-event").click also gets the correct response and opens the wizard > as expected. > > However, when I put this exact same command into a script file and execute > that, it instead goes back to the login screen. Logging in on that screen > takes me to a completely different part of the app. I've checked the > corresponding button that should take me to that part of the app and there > is no way that it could be confused with the element that I am identifying, > so it's not simply a case of having more than one element identified by the > same query. It has a completely different class. > > I am greatly confused by this and would appreciate any advice. > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
