I am going to guess that somewhere in your code you are accidentally clicking the wrong button. it happens. I would tell your team to add id's to the elements you need to interact with this will make things easier. you could also check and see all the links that match the locator you are using.
On Tue, Sep 2, 2014 at 8:03 PM, David Karl <[email protected]> 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. > -- -- 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.
