Verifying an Object Using the Verify Function

This functionality is supported only if you are using the Classic Agent.

Use this procedure to verify an object’s state using built-in verification methods or other methods in combination with the built-in Verify function.

  1. Complete the steps in Verifying a Test Case.
  2. On the Verify Window dialog box, click the Method tab. Silk Test Classic lists the methods for the selected class on the left.
  3. Check the Include Inherited check box to see methods that the class inherits.
  4. Select the method that will return the expected value and provide any needed arguments. You can specify a built-in method or a user-defined method (as long as it returns a value).
  5. Click OK.
  6. Silk Test Classic returns you to the test application.
  7. If you are writing a complete test case, record the cleanup stage and paste the test case into the script. If you have added a verification statement to an existing test case, paste it into your script and close the Record Actions dialog box.
  8. In the editor, wrap the Verify function around the method that returns the expected value as follows: Make the method call the first argument, specify the expected value as the second argument, and provide an error message string optionally as the third argument.

For example, here is a test case that verifies that the text in the TextField Replace.FindWhat is myText. It uses the built-in verification method VerifyValue.

testcase VerifyMethodTest ()
TextEditor.Search.Replace.Pick ()
Replace.FindWhat.VerifyValue
("myText")
Replace.Cancel.Click ()