RE: Wild Card
Use the * wildcard in your locator.
"RFQ Outright CANDEAL BOND 1010319024004711" in your example looks like a object map id. Open the object map and change the locator to use * instead of the number. For example, change //Dialog[@caption='RFQ Outright CANDEAL BOND 1010319024004711'] to //Dialog[@caption='RFQ Outright CANDEAL BOND*']
You might also want to change the name object map entry itself to make it easier to read (e.g. to just "RFQ Outright CANDEAL BOND" without a number)
RE: Wild Card
.Dialog("RFQ Outright CANDEAL BOND *") will not work because this means: "use the Xpath locator from object entry with the name 'RFQ Outright CANDEAL BOND *'".
Background info: An object map is a test asset that contains items that associate a logical name (an alias) with a control or a window, rather than the control or window's locator. Once a control is registered in an object map asset, all references to it in visual tests and scripts are made by its alias, rather than by its actual locator name. Only XPath locators support wilcards but names of object map entries do not support wildcards.
You can do the following to fix your script:
- first change your script back to With .Dialog("RFQ Outright CANDEAL 1010319024004711")
- find the object map that contains the dialog and open it
- In the object map change the value of the "locator path" column from //Dialog[@caption='RFQ Outright CANDEAL 1010319024004711'] to //Dialog[@caption='RFQ Outright CANDEAL *']
Does your script work with those changes?
If no, what is the error message that you get?