WinRunner custom dialogs: parameterize your scripts at run-time

Posted by Albert Gareev on Dec 21, 2007 | Categories: How to

How to input parameters for WinRunner scripts


In order to use a customizable dialog, you need to declare data fields and data handler that will populate them as per your needs/rules.

# create_custom_dialog specific fields

static _env_str, _case_str, _input_str;

public function _on_param_dlg(in env_str, in case_str, in input_str) {
 _env_str = env_str;
 _case_str = case_str;
 _input_str = input_str;

Then use WinRunner function create_custom_dialog to display a modal dialog window.

Note. Clean-up data fields first to remove values left from previous calls.

public function _param_dlg(inout env_id, inout case_id, inout input_id) {
 _env_str = "";
 _case_str = "";
 _input_str = "";
 create_custom_dialog ("_on_param_dlg", "Please type the pass-in parameters..", "Start", "Environment:, Test_Case:, Input_File:", "");

 env_id = _env_str;
 case_id = _case_str;
 input_id = _input_str;

  • Leave a Reply

    * Required
    ** Your Email is never shared

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.