Ajax TrueClient Vuser Functions

Ajax TrueClient Vuser Functions

Below are the list of Vuser functions present in Ajax TrueClient Functions.

TC.setParam :

  • It is used too save the string value to a parameter or to a other value.
  • So the equivalent function used in web script is : lr_eval_string.
  • Syntax : TC.setParam(name, value);
    • name. (String) The name of the parameter in which to save the value.
    • value. (String) The parameter value.
  • Example: TC.setParam("myparam", "paramVal");

TC.outputMessage :

  • It is used to display the message on the output panel of the Vugen.
  • But if your running the script in performance center or controller it will wrote the message to the Vuser logs.
  • One can also append the parameter values in the message using +.
  • So the equivalent  function used in web script is : lr_output_message.
  • Syntax : TC.outputMessage(text);
    • text. (String) The message text.
  • Example: TC.outputMessage("My output message");

TC.log :

  • It is also used to send the message to the Vuser log file.
  • But it will not display the message in panel during the test execution in the controller or performance center.
  • So you can send the status of the message using the available level.
  • Syntax : TC.log(text, level);
    • text. (String) The message.
    • level. Optional argument. One of the following:
      • "Error"
      • "Warning"
      • "Standard" (default value)
      • "Extended"
      • "Status"
      • "Status_msg"
  • Example: TC.log("my warning", "Warning");

evalXPath :

  • Used to save to the path of object on the page.
  • And also you can use the value to write your logic.
  • Syntax : evalXPath(xpath);
    • xpath. (String) The xpath query.
  • Example : evalXPath("//a[text()=\" New Mercury Tours \"]");

TC.evalC :

  • It is mainly used to call the C function from the trueclient script.
  • Function that is defined in the C-functions.c file.
  • Syntax : TC.evalC(funcname, functimeout).
    • funcname. (String) The function name.
    • functimeout. (Number) The maximum expected runtime, in seconds, of the function called by the step.
  • So one can also specify the limit that function should take to complete.
  • Example : TC.evalC("myFunc", 20);

Syntax :

TC.vuserStatusMessage :

  • It is mainly used to indicates which Vuser is handling the particular script.
  • So you can use this function to check which user is executing the script.
  • Syntax : TC.vuserStatusMessage(text);
    • text. (String) Any text string.
  • Example : TC.vuserStatusMessage("FlightStatus");

TC.getParam ;

  • It will returns the value of the specified parameter from the file.
  • So you can use that parameter in the script.
  • Syntax :  TC.getParam(name);
    • name. (String) The parameter name.
  • Example : TC.getParam("Filename");

TC.advanceParam :

  • It is used to specify parameter to the pick the next value in the file.
  • So this is mainly used for the parameter of type file or unique number.
  • But the equivalent  function used in web script is : lr_advance_param.
  • Syntax : TC.advanceParam(name);
    • name. (String) The name of the parameter to advance.
  • Example : TC.advanceParam("multi_row_param");

Leave a Reply

Your email address will not be published. Required fields are marked *