Yes, first You are doing an assertion in a when (in cucumber when is more for changing state) Second by ie.text I assume you are checking all of the text of the page better to locate the exact text location
Can you give us more info on what you want to do Sent from my iPhone On Oct 18, 2012, at 6:27 PM, Ry <[email protected]> wrote: > Is there a better way to write this? > > my goal to verifying text exists on the page and if it does to return to > previous page otherwise close the window > > When /^I should be taken to the my text page$/ do > > if ie.text('Modification of awesome things').visible? = true > then ie.back > else ie.close > end > end > > my error when running this is > > syntax error, unexpected keyword_else, expecting $end > else ie.close > -- > 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] -- 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]
