Call to WR from QTP Datatable Problem
I am using latest versions of both WR and QTP.
I have an existing Winrunner script which uses a data table for certain values. I would like QTP to call the WR script, but pass values from the QTP datatable to the WR script. I have inserted the following into my QTP script:
TSLTest.RunTestEx "C:\MyWRTest",FALSE,FALSE, DataTable("UserName", dtGlobalSheet), DataTable("Name", dtGlobalSheet), DataTable("IA_Id", dtGlobalSheet)
My problem is that my WR test is still using the values from the WR datatable. I've mucked with input parameters, etc., but the WR test doesn't seem to know that I'm passing my values from my QTP test. Any ideas on what I'm missing or if I need to edit my WR script somehow?
The QTP help on this is not very helpful!
Re: Call to WR from QTP Datatable Problem
I'm posting this in case someone else ever runs into this quandary!
Mercury Support sent the following that solved half of my problem:
...replicated the issue at my end and I was able to pass the values from QTP DataTable to WinRunner.
Here are the steps you need to do:-
1. Create a WR script with a test parameter, the steps to do it is listed below:
1.1 click on File->Test Properties
1.2 switc to parameters tab
1.3 click "add" and provide a name, for example, param1. Provide a description if you want.
1.4 in the script, you refer to this parameter as param1.
1.5 For example, you can have the following statement:
Create the number of parameters that you want to Pass from QTP.
Save the script and then call WR script from QTP.
ex. TSLTest.RunTestEx "D:\Customer issues\QTP-to-WR\WR",FALSE,FALSE,DataTable("col1", dtGlobalSheet) ,DataTable("col2", dtGlobalSheet)
Then to solve the rest of my issue, I had to break my WR scripts into three scripts and put looping logic around the WR script that was pulling its values from QTP. It works fine now.
Dim rowCnt, Rowcount
Rowcount = DataTable.GlobalSheet.GetRowCount
For rowCnt = 1 to Rowcount
TSLTest.RunTestEx " C:\WR_Script2",FALSE,FALSE, DataTable("UserName", dtGlobalSheet), DataTable("Name", dtGlobalSheet), DataTable("IA_Id", dtGlobalSheet)
TSLTest.RunTestEx " C:\WR_Script3",FALSE,FALSE