This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[Truclient] How to parameterize an Object Name/Path?

Hi,

 

I am using LR 11.52. I am having some trouble trying to parameterize an Object request. I want to select a gridcell object based on the content it contains. i.e. I have a grid filled with names, I want to randomly select a corresponding name from a parameter list I created, and have Truclient click on it. My problem is, I can't get the request to work.

 

Right now, I'm simply storing a value from my parameter list in a variable using Evaluate JS:

window.myGlobalVar=LR.getParam('myParam');

 Then, when I get to the step where I click on my gridcell, I use JavaScript to replace the text in the Object section, like so:

evalXPath("//td[text()=\"" window.myGlobalRep "\"]");

 When I do this however, I get an error stating "target object was not found." I have checked to make sure that my parameter list is working correctly, window.myGlobalVar definitely is assigned a value. I'm guessing my request syntax is incorrect, but I have checked a few times already, and I don't see an issue.

Parents Reply Children
  • Verified Answer

    0 in reply to 

    Hi,

     

    The issue with your function could be that it contains a character, written using keyboard language different from English. I made some checks in Notepad using different encoding and with one got:

     

    evalXPath("//td[text()=\"" ArgsContext.LR.getParam​("myParam") "\"]");

     

    For example the following code

     

    var myGlobalVar=LR.getParam(“myParam")

     

    will also produce

     

    Evaluate JavaScript code var myGlobalVar=LR.getPa...t(myGlobalVar); ** failed - exception occurred: SyntaxError: illegal character

     

    because in (“myParam")  â€ś is not written using English keyboard.

     

    Kind regards,
    Vesela