Creating a Password Dialog Box - WinRunner

A password dialog box has two edit fields, an OK button, and a Cancel button. You supply the labels for the edit fields. The text that the user types into the edit fields during the interactive test run is saved to variables for analysis.

You use the TSL function create_password_dialog to create a password dialog box. This function has the following syntax:

create_password_dialog ( login, password, login_out, password_out );

  • login is the label of the first edit field, used for user-name input. If you specify an empty string (empty quotation marks), the default label “Login” is displayed.
  • password is the label of the second edit field, used for password input. If you specify an empty string (empty quotation marks), the default label “Password” is displayed. When the user enters input into this edit field, the characters do not appear on the screen, but are represented by asterisks.
  • login_out is the name of the parameter to which the contents of the first edit field (login) are passed. Use this parameter to verify the contents of the login edit field.
  • password_out is the name of the parameter to which the contents of the second edit field (password) are passed. Use this parameter to verify the contents of the password edit field.

The following example shows a password dialog box created using the default edit field labels.

status = create_password_dialog ("", "", user_name, password);
Creating a Password Dialog Box
If the OK button is clicked, the value 1 is passed to the variable status. If the Cancel button is clicked, the value 0 is passed to the variable status and the login_out and password_out parameters are assigned empty strings.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics