Ideally I want to pick the item by actual name stored as a variable (Project.Variables.CUBEROOTWORKFLOWPROFILE)
So something like this, but I am having trouble replacing Sausages with a predefined Variable.
What would the syntax be to replace hard coded Sausages with the Variable stored in Project.Variables.CUBEROOTWORKFLOWPROFILE?
This does not work:
Aliases.Desktop.HwndSource_WindowHostWindow.WindowHostWindow.radComboBox.wText.**Project.Variables.CUBEROOTWORKFLOWPROFILE?**Thanks for any pointer.
But its unable to find that when I go to play it back.
It seems to need pointing to Aliases.Desktop.HwndSource_WindowHostWindow.WindowHostWindow.radComboBox.wText.
Error is
Total number of items: 5.
Items: ‘’, ‘’, ‘’, ‘’, ‘’.
In your first screenshot, you have a name mapping called radComboBox, and you are calling the method ClickItem, to click on item ‘3’, in your combo box
Assuming you have already defined a persistent project variable called, Project.Variables.CUBEROOTWORKFLOWPROFILE = 3
This is a slightly a different question from your original one, but the same principle applies, in using a variable.
Whatever value is stored in FRUITNAME variable, will be typed using the Keys operation, which is then followed by an carriage return. As shown in your screenshot,
If you have a variable called FRUITNAME having the following string value “Banana[Enter]Apple[Enter]Pear” and you use the Keys operation. It will enter each fruit name followed by a carriage return. You can find more information at Keys Action.
I’m not familiar with LoadRunner or Robot Framework, and there may be a terminology difference between the tools.
With TestComplete, you declare a variable and assign it a value - Project.Variables.FRUITNAME = “Banana”. To select “Banana” from your list control, use the mapped alias name followed by the appropriate method to click the item - Aliases.MyApp.ListOfFruits.ClickItem(Project.Variables.FRUITNAME).