Usage
Function Contains(
String Text,
Long MsTimeOut [Optional],
Boolean Report [Optional]
)
Step
Contains
ZAPTEST
1500
true
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
Step
Contains
ZAPTEST
Comment
Set MsTimeOut and Report optional parameters
Step
Contains
ZAPTEST
30000
false

Comment
Check if object contains "ZAPTEST" text