Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
122 views

TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

Hi All,

I have a set of 12.01 scripts which were recorded in TruClient (IE) protocol. We are upgrading to 12.53 and doing POC to ensure all scripts still work.

I have seen a few times now that the if statement fails saying that i is not defined (as screenshot below).
I'm clicking on the main play button for the script, and not the play button for the step itself.
I've recreated both the IF statement and the FOR statement.

I just double checked and it does get to the next step in Load mode, but I need get it working in Develop mode to fix futher identification issues.

 

Can anyone suggest anything?

 

FOR-IF.png

0 Likes
6 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

Hi,

Can you please try changing i to j or k and try again?

Meaning instead of for(var i=0; i<30; i++) change it to for(var j=0; l<30; j++). You will need to change the if statment to if j==25 as well

Regards,

Shlomi

 

 

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

Hi Shlomi, I had tried that and retried it. I changed the variable several times (j, k ,a), and changed (on my newly created if statement) the incrementer (i++) to i=i+1, finally changed it for the 3rd or 4th time and it suddenly started working.

(It did give an error on the if statement that the incrementer code wasn't recognised)

 

Very strange. I have the environment back so I can test on it so will check other scripts today.

Thank you.

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

I closed the script, and worked on another script and ran into the exact same issue. Can't get the 2nd script to work, I've tried changing the variable, and using quotes in the comparasion (javascript suggestion online)

Now when I go back to the first script it's giving me the same error again.

Not getting by this if statement

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

The same code works when replaying in IE mode. I'm getting object recognition issue which is something seperate, but the if statement is recognising the variable I declared.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

Hi Brian,

A defect about this issue was reported in version 12.50 (related to TC Chromium only). We thought we fixed it in 12,53, apparently not. 

As long as the for loop does not use i as the variable name and you do not query it inside the loop it should be OK. Use a different variable name for that. We will investigate it again and resolve.

Sorry for the inconvience.

Regards,

Shlomi

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: TruClient 12.01 (IE) scripts playing on TruClient 12.53 (Chromium) IF not working in FOR loop

Thanks Shlomi. I will try that work around.

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.