NOTICE: Our Community is moving. Get more information. Updated information on a New Login Process
How to use Wild Card to capture dynamic value in Dialog of Window application?
With.Dialog("RFQ Outright CANDEAL BOND 1010319024004711")
In this code, 1010319024004711 is a dynamic value which changes with every run.
Hi, 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) Michael
In reply to michaelg:
In reply to Varinderdeep:
.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:
Does your script work with those changes?
If no, what is the error message that you get?