Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
In anticipation of posting about a new topic I'm going to wrap up my Watir Automated testing posts with a few more top tips. UPDATE: I’ve been asked for links to my previous posts on Automated Testing so especially for Dave: Automated Functional Testing - Part 1 of ...Automated Functional Testing - Part 2 of ...Automated Functional Testing - Part 3 of ...Automated Functional Testing - Part 4 of ...Automated Functional Testing - Part 5 of ...Automated Functional Testing - Part 6 of ...TOP TIP - How do I run a single test? So you have lots of tests in your test suite but only want to run one? No need to create an ad-hoc test case, simply pass in the --name parameter when running the test: ruby test_mytestcase.rb --name test_just_this_methodTOP TIP - How do I run the test in background mode? Running the test so you can see what is going on in the browser is sometimes useful but most of the time you'll want to run the tests in the background and just see the results. This is easily done by passing the -b parameter on the command line: ruby test_mytestcase.rb -bTOP TIP - Helper methods I have a couple of helper methods which I use in most of my test cases:def should_find(find_me)   assert(@ie.contains_text(find_me), "*
*
*
Text not found: #{find_me}
*
*
*") end       def should_not_find(find_me)   assert_nil(@ie.contains_text(find_me), "*
*
*
Found text which should not be present: #{find_me}
*
*
*") end
No clever code here it just means I can write tests which are easier to read:should_not_find("Portal Runtime Error") should_find("Success")FINWell I'm running out of content about testing as you can probably tell! So I guess that’s a wrap. I'll no doubt re-visit automated testing again at some point but for now that’s my lot. NEXT TIMEI've been working on creating web services for Enterprise Portal and calling those web services from Microsoft .Net. I've taken lots of notes, so expect a series of EP web services posts real soon.
3 Comments