Verifies that the expected value equals the actual value and enables you to add a comment.
result = Workbench.Verify(condition[, VerifyFlags])
or
result = Workbench.Verify(condition[, comment, VerifyFlags])
or
result = Workbench.Verify(expected, actual[, VerifyFlags])
or
result = Workbench.Verify(expected, actual[, VerifyFlags, comment])
Variable | Description |
---|---|
result | Whether the verification was successful. BOOLEAN. |
condition | The condition that needs to be met. BOOLEAN. |
expected | The value that you expect the script to return. OBJECT. |
actual | The actual value that the script returns. OBJECT. |
comment | Optional: The comment to include. STRING. |
VerifyFlags | Optional: Whether a screenshot should be captured if the verification fails. This is an enumeration with the following possible values:
|
Workbench.Verify(expected As Object, actual As Object, comment As String)
For example, Workbench.Verify("red", "green", "checking colors") fails with the message checking colors - Actual: [green]; Expected: [red].
Workbench.Verify(expected As Object, actual As Object, comment As String, verifyFlags As VerifyFlags)
For example, Workbench.Verify("red", "green", "checking colors", verifyFlags.ScreenShotOnFailure) fails with the message checking colors - Actual: [green]; Expected: [red] and adds a screenshot to the result file.
Workbench.Verify(condition As Boolean, comment As String)
For example, Workbench.Verify(True, "Test Passed") passes. While Workbench.Verify(False, "Test Failed") fails.
Workbench.Verify(condition As Boolean, comment As String, verifyFlags As VerifyFlags)
For example, Workbench.Verify(True, "Test Passed", verifyFlags.ScreenShotOnFailure) passes and adds no screenshot. While Workbench.Verify(False, "Test Failed", ScreenShotOnFailure) fails and adds a screenshot to the result file.
Workbench.Verify(expectedEnumerable, actualEnumerable)
Dim selectedItemsList = listBox.SelectedItems ' we assume that a list with the items "red" and "blue" is returned Dim expectedItemsList = New List(Of String)() expectedItemsList.Add("red") expectedItemsList.Add("blue") Workbench.Verify(selectedItemsList, expectedItemsList) ' verification passes Dim expectedItemsArray = New String() { "red", "blue" } Workbench.Verify(selectedItemsList, expectedItemsArray) ' verification passes