ioioio
8 years agoOccasional Contributor
Construct a object if I know the object name
Hi, I have the following call: Call Aliases.browser.page.formForm0.radiobutton1YearSubscription.ClickButton where radiobutton1YearSubscription is a radio button in a form. In the same form i...
- 8 years ago
Hi,
All scripting languages have an equivalent of the evaluate() or eval() function that accepts a string, executes it as code and returns a result.
The code for your case will be like that (VBScript pseudocode that should be adjusted to match the language used in your project):
... BTNy = "radiobutton1YearSubscription" ... strObjAlias = aqString.Format("Aliases.browser.page.formForm0.%s", BTNy) Set oObj = Evaluate(strObjAlias) If (oObj.Exists) Then Call oObj.ClickButton() Else ... End If