This documentation applies to the 8.0 version of Remedy Action Request System, which is in "End of Version Support." You will not be able to leave comments.

To view the latest version, select the version from the Product version menu.

BMC Remedy Mid Tier scripting and basic parameterizing

Use this section to learn how to script BMC Remedy Mid Tier. It also describes how to parameterize several basic values (you can use the same method to parameterize other values).

To create a basic script with SilkPerformer

  1. Enter the URL for the BMC Remedy Mid Tier page that you want to access.
  2. Put comments before each action and save the script. For more information, see Basic scripting and replaying .
  3. Remove any WebCookieSet() and Thinktime() functions the script contains.
    When you run your workload, SilkPerformer manages each user's cookies internally, so the WebCookieSet() functions need to be removed. You cannot prevent SilkPerformer from recording these functions, so you must manually remove them.
    You can, however, prevent SilkPerformer from recording Thinktime() functions when you are inactive during recording. See Configuring think times and maximum line length.
    The script should contain WebRemedyBackChannelUrl() functions. These are specific to the SilkPerformer BMC Remedy plug-in. If you record a script against a BMC Remedy AR System application and do not see these functions in your script, the plug-in is not installed.
  4. To create a portable script, create variables for the AR System server name, user name, web server, and port number variable.

    Creating a header file
    BMC recommends putting the variables in a header file that can be shared by other scripts.
    To create a header file
    1. Choose File > New > Include File.
      This is a sample header file:
      use "kernel.bdh"
      use "WebAPI.bdh"
      gsUsername : string;
      gsPassword : string;
      gsWebServerPort : number init 8080;
      gsWebServer : string init "myWebServerName";
      gsARServer : string init "myServerName";
    2. Include the header file in your script, by using the use keyword (see Table 1).
      Replace AR System server and user names
      Search for all AR System server and user names and replace them with the appropriate variable in the header file.
      For example, replace most occurrences of myServerName with "gsARServer" (include the double quotation marks). In SilkPerformer syntax, the first double quotation mark ends the previous string, and the plus sign appends the value of the gsARServer variable to that string. The second double quotation mark starts the next string.

      Replace web server and port number
      Use the keyword standardhost to replace all occurrences of the web server and port number.
      Then, in the header file, create an initialization function such as the following that sets the browser and standardhost values:
      function fInitialize
      WebSetStandardhost(gsWebServer, gsWebServerPort);
      end fInitialize;
      Then, in the TInit transaction of your script, replace everything in the function with a call to the new initialization function. For example, call the preceding fInitialize function as follows:
      transaction TInit
      if FileCSVLoadGlobal(csvfile, "usernames.txt", ",") then
      gsUsername := FileGetCol(csvFile, 1, MAX_LEN);
      gsPassword := gsUsername;
      end TInit;
      Alternatively, set a configuration that does this during recording. See SilkPerformer configuration settings. (BMC recommends the first method.)
  5. After replacing user names with a global variable, set up a mechanism to find the value of this variable.
    BMC recommends reading an external file for the user names. Making the password the same as the user name is also a good idea.
    The TInit transaction in the preceding step shows how to read a user name file (see Replace web server and port number). This global file is accessed by only one virtual user at a time, ensuring unique logins.
    In the dclform section for the login, disable encryption of the password by setting encpwd to 0. In addition, replace the password with the variable:
    ARSYS SERVLET LOGINSERVLET: "username" := gsUsername, "pwd" := gsPassword, "auth" := "", "timezone" := "America/Dawson", "encpwd" := "0", "goto" := "", "server" := "", "ipoverride := "0", "initialState" := "0";
  6. In the dclform section, check each web form for values that might need to be parameterized.
    For example, here is a sample web form:
    "param":= "<?xml version='1.0'?>\r\n"
    "<RemedyXml operation=\"GetEntryList\">\r\n"
    "  <string name=\"current_server\">myServerName</string>\r\n"
    "  <string name=\"current_schema\">SRS:ServiceRequestConsole</string>\r\n"
    "  <string name=\"server\">myServerName</string>\r\n"
    "  <string name=\"schema\">SRD:ServiceRequestDefinition</string>\r\n"
    "  <string name=\"app_name\"></string>\r\n"
    "  <string name=\"qualification\">4\\1\\99\\302769000\\1\\179\\</string>\r\n"
    "  <Array name=\"qual_field_ids\">\r\n"
    "    <long>302769000</long>\r\n""  </Array>\r\n"
    "  <Array name=\"qual_field_values\">\r\n"
    "    <string>SR00142215278B067URQKtGHAA3lQC</string>\r\n"
    "  </Array>\r\n"
    "  <Array name=\"qual_field_types\">\r\n"
    "    <int>4</int>\r\n""  </Array>\r\n"
    "  <int name=\"no_match_opt\">2</int>\r\n"
    "  <int name=\"multi_match_opt\">3</int>\r\n"
    "  <Array name=\"fields\">\r\n"
    "    <long>302825900</long>\r\n"
    "    <long>302799500</long>\r\n"
    "  </Array>\r\n"
    In this GetEntryList call, the bold values should be put in variables. You took care of myServerName, the AR System server name, in the previous step. But the value SR00142215278B067URQKtGHAA3lQC still needs to be put in a variable. Where does this value come from?
    1. Use the Silk TrueLog Explorer on the recorded output file (yourScriptName.record.xlg).
    2. Open the file, and choose Edit > Find.
    3. Select the body (in data) option and enter search criteria for SR00142215278B067URQKtGHAA3lQC (see the following figure).
      Silk TrueLog Explorer Find dialog box
      (Click the image to expand it.)

      This searches for the value in an HTTP response only. You want to know which HTTP request includes this value.
      When the request is found, it is highlighted in the left pane of Silk TrueLog Explorer (see the following figure).
      Silk TrueLog Explorer search results
      (Click the image to expand it.)

      You can now go to the script with that request and parse the response. See Parsing AR System table entries.
  7. Search for all matching values and replace them with the appropriate variable from your header file (see Create a header file).
  8. Choose Script > Compile to save and recompile.
Was this page helpful? Yes No Submitting... Thank you