Hi Charley,

Can you tell me how to overcome the same in Watir 1.4.1. Its not only related 
to assertions, the problem i am facing is if the method which i am calling if 
does not execute for some reason the  next step of the code does not executes 
in the called method. So, is there any other way to over come this problem in 
Watir 1.4.1?

Any suggestions  most welcome 

Thanks,


 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  
_______________________________________________
Wtr-general  mailing list
[email protected] 
http://rubyforge.org/mailman/listinfo/wtr-general



       
---------------------------------
 Check out what you're missing if you're not on Yahoo! Messenger 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to