Highlighted
Outstanding Contributor.
Outstanding Contributor.
474 views

Pass Machine name in Truclient script

Hi .

I have truclient script , i am running this script for six location with six username and password specific to location.

How i can pass this machine as parameter in the truclient script? Please suggest.

Regards,
hp4u
0 Likes
8 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Pass Machine name in Truclient script

You can add a parameter in VuGen (e.g. MachineName).

In the script use Evaluate JavaScript step and write inside it TC.getParam("MachineName") to get the value. You should place user name and password in the same row as the machine name and make sure the parameter selection is set to take the value from the same row as machine name row.

Hope it helps

Shlomi

Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Pass Machine name in Truclient script

Thanks, i insert evaulate java script code and its taking paramter of 1st line only, How to get the machine name in  evaulate Javascript?

Regards,
hp4u
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Pass Machine name in Truclient script

Hi,

Can you please share a screenshot or description of the parameters settings?

I can give an example of my own but I am not sure it will address your exact need

Thanks,

Shlomi

Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Pass Machine name in Truclient script

Hi,

Please see snashot

Regards,
hp4u
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Pass Machine name in Truclient script

Hi,

You have only one line in User Name and Password parameters. Can you please check what happens when you add the same amount of rows in these parameters to match the number of the rows in the Location parameter?

Also, if you run the script only one iteration it will always pick the first row. Did you run it for several iterations? Next iterations are supposed to use different lines.

Regards,

Shlomi

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Pass Machine name in Truclient script

I did, but how/where it will identify machine name , where should i get machine name?

Regards,
hp4u
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Pass Machine name in Truclient script

Hi,

I was under the impression that the Location represents the machine name.

You can either add the machine name as yet another column/parameter and get it from there or use Evaluate JavaScript step with the following code in it

var machineName = Utils.getEnv("COMPUTERNAME");

I am not sure how you are going to determine the user name and password based on the machine name though. I got confused again about what you are trying to achieve

Regards,

Shlomi

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Pass Machine name in Truclient script

Hi.

I was under the same impression as Shlomi, that location and machine-name were connected, so I have nothing to add there.

But for the Location, Username and Password to work in the easiest way, you should have them in the same file. So change Password and UserName parameters to use the file "Location.dat" in the dropdown.

br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

.
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.