Highlighted
Frequent Visitor..
Frequent Visitor..
214 views

[LR 12.55] 'Path': value can not be empty

I'm currently developing a Truclient script which downloads a PDF. This PDF is downloaded by default in %LG_PATH%bin\chrome\*.pdf

The problem comes when trying to verify this PDF file. I want a relative path that depends on %LG_PATH% environment variable value.

I defined a Javascript variable named path.

var name = Utils.getEnv('LG_PATH');
var path = name + "bin\\chrome\\0001051900.pdf";

But this Truclient script fails:

Capture.PNG

 

 

 But 'Path' is not empty!

Prova.PNG

 

 

 

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: [LR 12.55] 'Path': value can not be empty

When you like to use javascript variables, in TruClient step-arguments, you need to take care of the namespace. A javascript step that generates a values has it's own local namespace. So your 'var path' will not survive the execution of that java script code.

If I remember correctly, you should use e.g. Global.path. In some situations you even need to prefix this again with a namespace, but that is listed near bottom when you open the javascript editor of javascript value of your TruCient Step.

Signature:
Reward community members who take time to respond and help.
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.