Highlighted
Outstanding Contributor.
Outstanding Contributor.
257 views

VuGen TrueClient Evaluate Javascript question

I need to verifiy a dynamic value of cells in a table which should be numeric but for some reason are sometimes displayed with parenthesis.

I've written a javascript function in an "Evaluate Javascript on Object" step which sucessfully gets the value from the cell and removes the non numeric chars, but the issue now is that I'm not sure about how to evaluate this new value in a way that affects the script flow (eg. generate an error if the value is different from the expected value).

Adding the comparison to the Evaluate Javascript step doesn't seem to work the way I need. The javascript is evaluated, but the script doesn't seem to care about whether the result of the numeric comparison in the javascript code is true or not.

I basically just need something like a  "Verify" step for a value that's been calculated in an "Evaluate Javascript on Object" step. How can I do that?

 

Regards.

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: VuGen TrueClient Evaluate Javascript question

Hi,

It sounds to me like you need to have a Get Property step to save the data. Then Evaluate JavaScript step to parse it. The evaluate JavaScript step can also save a boolean value to refer to in a IF statement that will determine what do to with it later.

Alternatively you can save the boolean value in the evaluate JS on object and add IF statement later to branch the logic based on it

 

Regards,

Shlomi

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.