To start with , this being my first blog, I would like to mention How would I like to unfold the topics.
To begin with , the first mention the VB script can do to automation is running scripts in batches. Well, you may think, there are tools like Test Batch runner, Multitestmanager, QC batch run program, but all of these have their own disadvantage. Either they can run only those scripts that are located locally/shared or they can be run with Quality center effectively. The quality center batch run utility( the one that you launch from QC after selecting tests) can run only those tests that are from single test set. If you want to run tests from multiple test sets in quality center, you have to run in separate batches.
Okay lets move on to what VB script can power our batch runs. QTP has innumerous object functions/libraries that VB script can access. These collectively are called QuickTest Professional Automation Object Model.
To run a batch of scripts, we have to following activities
- Launch QTP application.
- Connect to QC and Open the test ( or from locally defined path)
- Add/Check resources
- Add/Check Recovery scenarios
- Set Global Options
- Set Test parameters
- Set Test results options
- Run the test
Set appQTP=CreateObject("QuickTest.Application")
If appQTP.launched <> True then 'Launch QTP application
appQTP.launch
If Err.number <> 0 Then
strErrMsg = "Error occured while Attempting to launch QTP" _ &vbNewLine & Err.Description
wscript.echo strErrMsg
End If
End if
* Remove the code in blue if you arent trapping error using On error Resume next
No comments:
Post a Comment