search, contain, have, sub, substring, scriptless, script-less, scripted, step, view, stepview

Method Contains

Checks if the object partially contains a certain text

Watch this video to learn how to use this method

Have a problem with playback?

Usage

Function Contains( 
        String Text, 
        Long MsTimeOut [Optional],
        Boolean Report [Optional]
)

Step

Contains

ZAPTEST

1500

true

Text

MsTimeOut

Report

Parameters

Text

Type: String

Text to be checked for

MsTimeOut (optional)

Type: Long

Default Value: Global timeout value (from ZAPTEST Options)

How long to look for the text before failing in milliseconds

Report (optional)

Type: Boolean

Default Value: True

Report this step into Test Results

Returns

True if operation is successful; otherwise, false

Example

VBScript

'Let's take an object which contains string "ZAPTEST demo object".
Application("Demo").View("DemoView").Object("DemoObject").Contains("ZAPTEST") 'true
'set timeout and disable this step report to test result
Application("Demo").View("DemoView").Object("DemoObject").Contains("dummyString", 10000, false) 'false

JavaScript

// Let's take an object which contains string "ZAPTEST demo object".
Application("Demo").View("DemoView").Object("DemoObject").Contains("ZAPTEST"); // true
// set timeout and disable this step report to test result
Application("Demo").View("DemoView").Object("DemoObject").Contains("dummyString", 10000, false); // false

Comment

Check if object contains "ZAPTEST" text

Step

Contains

ZAPTEST

Comment

Set MsTimeOut and Report optional parameters

Step

Contains

ZAPTEST

30000

false

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227