Get your 6-month No-Cost Opt-Out offer for Unlimited software automation!

Method Contains

Checks if the object partially contains a certain text

Usage

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

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

Documentation Categories

ZAPTEST

FARM

LOAD