Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
601 views

LR 12.01 TruClient variable is undefined after several iterations

Hi All,

Having a weird issue, hope someone can suggest something.

I am using TruClient IE on LR 12.01. I have variable reading in a parameter for a URL.

     var pURL1=LR.getParam('pURL')

I called the JS variable something different to the LR parameter *incase* there was some scope conlict, also removed any comments from before the declaration step; I also just tried putting in a second delay after declaring the variable before i used it in the load step and still happening.

The script will play through several iterations, of logging into the AUT, doing a search, opening a PDF, then logging out. There is just one value of my URL in my parameter file.

It will run through several iterations perfectly and then give an error saying that the variable that I'm using in the Navigate to step is undefined. (even though it's successfully ran several iterations!). Error log below and screenshot attached.

Has anyone seen anything like this? Or suggest anything?

 

12:04:20: ** 16.4: Select Archive file in option #1 from element (2) listbox ** successfully completed
12:04:20: ** 16: If Search resultexists ** successfully completed
12:04:20: ** 17: Wait 3 seconds ** started
12:04:24: ** 17: Wait 3 seconds ** successfully completed
12:04:24: ** 19: Click on Exit Documents image ** started
12:04:25: ** 19: Click on Exit Documents image ** successfully completed
12:04:25: ** 20: Verify Login's "Visible Text" contains "Login" ** started
12:04:25: ** 20: Verify Login's "Visible Text" contains "Login" ** successfully completed
12:04:26: ** 1: Evaluate JavaScript code var pURL=LR.getParam('pURL') ** started
12:04:26: ** 1: Evaluate JavaScript code var pURL=LR.getParam('pURL') ** successfully completed
12:04:27: ** 2: Navigate to pURL ** started
12:04:27: ** 2: Navigate to [Exception] ** failed - an argument is invalid:
'Location': JavaScript exception 'ReferenceError: 'pURL' is undefined' during evaluation

 

Thanks,
Brian.

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: LR 12.01 TruClient variable is undefined after several iterations

Very strange indeed. 

First, as a workaround I suggest adding/modifying the code in the "Evaluate JavaScript" step that comes before the navigation step to avoid the failure

var strURL=LR.getParam("pURL");

// fallback option in case the parameter returns no data

if (!strURL) { strURL = "http://<hardcoded_value>"; }

Second, can you please share the script? You can delete all the steps apart from the first couple of steps. Alternatively, attach a snapshot of the parameter dialog so we can see the policy of that parameter

I suggest opening a support ticket regardless 

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.