Parameterizing using evaluate javascript

Hi ,

I want to user parameters by evaluate javascript option for giving input.
I tried object.setvalue="{parametername}" and
object.value=TC.getParam("parametername"), but none of it works.
can someone help me what code should is use here.

Best Regards


  • Hi Vishal,

    It is unclear what you are trying to do.
    If you are trying to locate an object in the application using a value taken from a parameter and this code is going to be embedded in the Object Identification section of the step you need to use ArgsContext.TC.getParam("ParamName") concatenated to JavaScript evaluation code.

    If you are trying something else please clarify in more details and attach a screenshot of the step and possibly the steps surrounding it.

    Also, look at the Object Identification samples in TruClient online help. It might help as well.


  • HI Shlomi,

    Thanks for the quick response.

    I need to set different dates in a field, but truclient wasn't recording the step , neither i was able to change the action from "click" to "type" as the option "type" was not available.
    I figured it out as , I used click on the object and changed the action to "evaluate javascript", 
    So I used object.value="2018.10.10"
    Issue : I need to pramaterize the dates or even other criteria. so how can i parameterize it using javascript from the parameters list in table form.

    Please see the attachment , I wan't to parameterize the user id here using evelaluate javascript. I am not fetching the parameter values from anywhere , but i have already created the parameters in tabular form. 
    Please let me know the soultion or if you have any questions.


    Best Regards



  • You should use the TC.getParam API to extract the parameter value.

    The best practice, in this case, would be to use a Generic API step to invoke this command, store the parameter value in a variable and use that value in your logic (setting the object value.

    Add the Generic API step from the Toolbox manually.

    See the screenshot below:

    TC use param.png


  • Thanks Edo for the solution,

    Is the "Generic API step" available for LR 12.50? 


    Best Regards


  • Verified Answer

    The Generic API step was added in version 12.53.

    In version 12.50 you can still call the API from your JavaScript code:

    var myValue=TC.getParam("ParamName");