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.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
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 watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to