Error: "Object doesn't support property or method 'indexOf'" when saving the "Speed simulation" run-time settings of a TruClient script

  • KM01650670
  • 05-Jun-2015
  • 15-Jun-2015

Summary

An error is received when trying to save the "Speed simulation" run-time settings of a TruClient script. As a result the settings are not saved and the "Save" button becomes disabled.

Error

An error is received when trying to save the "Speed simulation" Run-time settings of a TruClient script:

"Script Error: An error has occurred in the script on this page.
Error: Object doesn't support property or method 'indexOf'"


As a result the settings are not saved and the "Save" button becomes disabled.

Cause

The issues is caused by missing default values for the speed simulation settings.

Fix

To fix the issue for the current script:

  1. Open the default.cfg file in the script folder.
  2. Go to the [ModemSpeed] section
  3. Add values for the ModemSpeedUpload, ModemSpeedDownload and ModemSpeedDownloadAndUpload settings.
    For instance:

    [ModemSpeed]
    ModemSpeedMode=1
    ModemSpeedUpload=0
    ModemSpeedDownload=0
    ModemSpeedDownloadAndUpload=0

  4. Save the file and reopen the script in TruClient
  5. Go to the Run-time settings > Network > Speed simulation. Changing and saving the values should work now.

To fix the issue for any new scripts, modify the run-time settings templates for TruClient IE and Firefox:
Apply the above changes to the following default.cfg file:

  • <LoadRunner installation>\template\WebIE\default.cfg
  • <LoadRunner installation>\template\Web2UI\default.cfg

After saving the changes, any new TruClient script will have the default runtime settings for "Speed simulation"