input, inputbox, textbox, user, userinput, scriptless, script-less, scripted, step, view, stepview

Method Zap.InputBox

Shows InputBox and Returns typed text data

Watch this video to learn how to use this method

Have a problem with playback?

Usage

Function Zap.InputBox ( 
	String PromptMessage [Optional],
	Boolean CollapseMainWindow [Optional],
	String DefaultResult [Optional]
)

ZAP Utility

ZAP Utility step

Zap.InputBox

Hello!

true

default

result

String PromptMessage

Boolean CollapseMainWindow [Optional]

String DefaultResult

Output Parameter

Parameters

PromptMessage (optional)

Type: String

Default value: "Input the text:"

Prompt Message for Input Dialog

CollapseMainWindow (optional)

Type: Boolean

Default value: true

If true it collapses Main ZAPTEST Window when dialog appears

DefaultResult (optional)

Type: String

Default value: Empty String

Default result if user clicks close button

Returns

String with user typed text data

Example

In this example we will use InputBox and InputPasswordBox to allow user manually type login and password on the view and login on the page

VBScript

username = Zap.InputBox("Please enter username:", true, "DemoUser")
password = Zap.InputPasswordBox("Please enter password:", true, "demo")
Application("Demo").View("DemoView").Object("txtUsername").Type username
Application("Demo").View("DemoView").Object("txtPassword").Type password
Application("Demo").View("DemoView").Object("btnLogin").Click

JavaScript

var username = Zap.InputBox("Please enter username:", true, "DemoUser");
var password = Zap.InputPasswordBox("Please enter password:", true, "demo");
Application("Demo").View("DemoView").Object("txtUsername").Type(username);
Application("Demo").View("DemoView").Object("txtPassword").Type(password);
Application("Demo").View("DemoView").Object("btnLogin").Click();

Comment

Use InputBox to allow user manually type login and save it to "login" variable

Script-Less next step

ZAP Utility

ZAP Utility step

Zap.InputBox

login

Script-Less next step

Comment

Use InputBox to allow user manually type login and save it to "login" variable

Script-Less next step

ZAP Utility

ZAP Utility step

Zap.InputBox

Enter login:

true

user1

login

Contact Us

3150 Roswell Rd NW

Atlanta, GA, 30305, USA

(800) 795-3552