I cannot Verify $Name Property during Playback

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

If you do not explicitly set the native $Name property of a Java control, Java (AWT) assigns a different default name to each instance of the control. As a result, you will not be able to verify the $Name property of the control because it will have a different name each time you run your test, and each time you close and reopen it during one test run.

When you want to verify the $Name property of a Java control, explicitly name the control by adding a call to the native method setName in your script before each call to VerifyProperties.

If you do not want to verify the name of a Java control, make sure you uncheck the $Name property in the Verify Window dialog box.

Example

VerifyProperties will fail in the following script because the JavaAwtCheckbox TheCheckBox is assigned a different $Name during playback than when the test case was recorded:
testcase Test1 () appstate none
  recording
    TestApplication.SetActive ()
    TestApplication.Control.CheckBox.Pick ()
    xCheckBox.TheCheckBox.VerifyProperties ({...})
      ""
      {...}
        {"$Name", "checkbox0"}
    xCheckBox.SetActive ()
    xCheckBox.Exit.Click ()
We can make the test run successfully by explicitly setting the name of TheCheckBox before verifying properties, as shown in the following script:
testcase Test1 () appstate none
  recording
    TestApplication.SetActive ()
    TestApplication.Control.CheckBox.Pick ()
    xCheckBox.TheCheckBox.setName("checkbox0")
    xCheckBox.TheCheckBox.VerifyProperties ({...})
      ""
      {...}
        {"$Name", "checkbox0"}
    xCheckBox.SetActive ()
    xCheckBox.Exit.Click ()