Highlighted
Respected Contributor.
Respected Contributor.
1934 views

What is TestArgs

Jump to solution

Hi, 

I have this code from someone. I am trying to understand the code for test args.  

Questions:

What is the testargs doing?

What is the parameter Excel_Filename for

filename will have what value?

Do I need to set up the testargs with parameter somewhere in UFT/ALM?

filename = TestArgs("Excel_Filename")

Reporter.Filter = rfDisableAll
If  IsExecutedFromQC = TRUE Then

 Else
        fname = filename
        lfilePath = "C:/Temp" & Mid(filename, InStrRev(filename, "/"))
   End If

Thanks.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: What is TestArgs

Jump to solution

filename = TestArgs("Excel_Filename")

"Excel_Filename" - is the test parameter

TestArgs() - function to access test parameters

What is the testargs doing? - they are the parameters that you can pass to your test - you can pass any number of testargs

What is the parameter Excel_Filename for?  - looks like filename of an excelsheet residing on a local drive is being passed to the UFT script and a part of the filename is being used to further processing.

filename will have what value? - variable to which the value of test parameter is getting saved

Do I need to set up the testargs with parameter somewhere in UFT/ALM?

Yes you can setup testargs in test parameters


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.

View solution in original post

0 Likes
3 Replies
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: What is TestArgs

Jump to solution

Impossible to say - TestArgs appears to be a local function in your library so you'd have to go look at that specific function and see what it's doing.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: What is TestArgs

Jump to solution

As I understand it (and I'm only 2 months into UFT), test args are the inputs into the test.  They're similar to parameters to an action. 

If you open the Test and view the flowchart, you can click on the Start element and see there are parameters you can create for it (the footprint icon). 

Capture1.PNG

 

After you've added your arguments, you can specify values for them when you run the test.  I assume there's a way to run it in a scripted fashion so you can specify them via the commandline or some vb/c#/etc language.

Capture2.PNG

So to answer your questions:

 

> What is the testargs doing?

See above comments

> What is the parameter Excel_Filename for?

When you start the script, you can point your script to and Excel file to use.

> filename will have what value?

Based on the usage, you (or somebody) should pass in a string that would be the filepath

> Do I need to set up the testargs with parameter somewhere in UFT/ALM?

Assuming this is an existing script, I would assume they have it all set up and you just provide the filepath. 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: What is TestArgs

Jump to solution

filename = TestArgs("Excel_Filename")

"Excel_Filename" - is the test parameter

TestArgs() - function to access test parameters

What is the testargs doing? - they are the parameters that you can pass to your test - you can pass any number of testargs

What is the parameter Excel_Filename for?  - looks like filename of an excelsheet residing on a local drive is being passed to the UFT script and a part of the filename is being used to further processing.

filename will have what value? - variable to which the value of test parameter is getting saved

Do I need to set up the testargs with parameter somewhere in UFT/ALM?

Yes you can setup testargs in test parameters


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.