Hi watir user,

 You can use the assertions methods that Bret wrote in watir/assertions.rb
that's included Watir 1.5.1.1100 and later (if you're using 1.4.1 you can
pull that file from subversion and use it).

To use the verify methods:
require 'watir/assertions'

Change your asserts to verify and assert_equal to verify_equal:

def assertButton
 verify($ie.button(:caption, "Click Me").enabled?)
end

etc.

def check_controls
 assertButton
.....
end

Verify methods will be counted as assertions in the test unit run without
exiting out of the calling method.

-Charley

On 4/9/07, watir-user watir-user <[EMAIL PROTECTED]> wrote:

Hi,

Following methods i want to call in another method

def assertButton
assert($ie.button(:caption, "Click Me").enabled?)
end

def assertLink
assert($ie.link(:text, "Click Me").exists?
end

def assertTextfield
assert($ie.text_field(:name, "field1").exists?)
end

def assertRbutton
assert($ie.radio(:value,"radio button").isSet?
end

def check_controls
assertButton
assertLink
assertTextfield
assertRbutton
end

The problem i am facing here is, in check_controls method if assertLink
method fails, it wont executes the next step of code just it comes out of
the method. But what i wanted is even if assertLink method fails it should
execute the remaining methods (or next step of code)i.e, assertTextfield and
assertRbutton

Please help me in this regard,

Thanks in Advance
Watir User

------------------------------
Here's a new way to find what you're looking for - Yahoo! 
Answers<http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/>


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to