Finds an object specified by an XPath locator or an object map identifier. Returns the first object that matches the locator. As long as no object matches the locator, the agent tries to find an object until the default timeout, which is specified by the option Options.ObjectResolveTimeout, expires. If no object is found an ObjectNotFoundException is thrown. You can set the Options.ObjectResolveTimeout option in the Synchronization tab of the Script Options dialog box. The option is called OPT_WAIT_RESOLVE_OBJDEF in the UI and is located in the Object resolve timeout section of the tab. The default value for the timeout is 5 seconds.
myWindow.Find(Of PushButton)("//PushButton[@caption='ok']").Select()Or:
myWindow.PushButton("@caption='ok'").Select()
myWindow.Find(Of PushButton)("ok").Select()Or:
myWindow.PushButton("ok").Select()
TestObject.Find(locator, [options])
TestObject.Find(locator, [options])
Variable | Description |
---|---|
locator | The XPath locator or object map identifier. Defines which object to find. String. |
options | Optional: Specifies options for the find operation. Can be used to override the default timeout or to specify that null (nothing in Visual Basic) should be returned if no object is found instead of throwing an exception. |