Quality is delighting customers
I have two test cases: Google1 and Yahoo1
In the cases I have codes like:
I have two text files. In text file "path" I have the test cases paths as-
C:\Documents and Settings\Administrator\My Documents\Unified Functional Testing\Google1
C:\Documents and Settings\Administrator\My Documents\Unified Functional Testing\Yahoo1
in text file "Credentials" I have the -
In a .vbs File I have these codes-
Set objTS=objFSO.OpenTextFile("C:\Documents and Settings\Administrator\Desktop\path.txt",1)
Set objTD=objFSO.OpenTextFile("C:\Documents and Settings\Administrator\Desktop\Credentials.txt",1)
Do Until objTS.AtEndOfStream=True
Do Until objTD.AtEndOfStream=True
If Environment("TestName") = Arr1(0) Then
Now my question is I want to execute the test cases from the .vbs file and then want to pass the credential data which is Arr1(1) here to the wed edit boxes when Arr1(0)=Environment("TestName"). But I am totally confused how to do this. Another thing when I run this .vbs file it throws an error saying either Type Mismatch "Environment" or object required "Environment". Please help me to solve this problem. Thanks in advance.
Here is what i understood your problem.
You wanted to pass some data from VBS file to QTP test script. correct?
If yes, they way you are passing data using environment variable is not possible. You are linking two difference interfaces.
Launching QTP from VB Script is called AOM. QTP has given separate Test Args component to pass data between VBS file and QTP Test Script file for Input and Output parameters. Just like Action Input & Output parameters.
Google QTP TestArgs you definitely get some help.
First of all thanks for your reply. Yes I wanted to pass some data from VBS file to QTP test script. I do not want to pass data by environment variable, but i want to make sure that test case names do not contradict When the test case names will match date related to that particular test will be passed to the edit box for search. Can you please help me to solve this problem? and Why I am getting the runtime error?
There was no command / function named Environment in VB Script. You should use below object to create test parameters to pass / get any value from VB Script to QTP.
Set rtParams = appQTP.Test.ParameterDefinitions.GetParameters()
Please try yourself that would give huge confidence on you programming and QA skills. I understand it takes time but it is good for your career.
thank you for your help. I am trying to solve it.
Can you please tell me why i am getting error on last line saying "object required"? here is my code:
For p = 1 To objDOM.length Step 1