Forum Discussion
I think I'm starting to understand the problem you are having. You have a table that has e.g. ToolButton2, ToolButton1, ToolButton3 etc. and you want to perform a click button action based on the value received from the table i.e. ToolButton2.ClickButton()
Similar to the code example,
Aliases.IsoSpeak.MainOptionsModule...Widget.ToolButton2.ClickButton()
Aliases.IsoSpeak.MainOptionsModule...Widget.ToolButton1.ClickButton()
Aliases.IsoSpeak.MainOptionsModule...Widget.ToolButton3.ClickButton()
You can use eval() function to evaluate JavaScript code represented, which means creating a function and calling the code from your keyword test.
- Iso_Yura2 years agoContributor
Yes, that's exactly what I want! My test should create 6 different projects, where each project is == to a different button("Aliases.IsoSpeak.MainOptionsModule.centralWidget.uiLayoutWidget.NewProjectMenuModule.Widget3.Widget.ToolButton2"), in total there are 6 buttons. So, I will have 6 lines with values in my DB Table, later I plan to make it data driven loop.
I never used eval() will check it now.
- Iso_Yura2 years agoContributor
I found that I can do it under Operation Parameters:
This is how my test step looks like(it's a different button, but concept is the same):
When I run it I keep getting an Exception error: "Unable to evaluate the operation's "Shift" parameter. Error: RuntimeError: The specified object is not indexable"
- Iso_Yura2 years agoContributor
Also, I just found in TC documentation that Shift is a button:
Parameters
The method has the following parameter:
Shift
Specifies the key that will be pressed during the click. See TShiftKey.
Now I'm confused, can I even use a variable for ClickButton operation if it refers to a key not to the object?
From documentation: "You can click a button by simulating keystrokes that represent an access key. An access key is an underlined symbol within the button caption. It permits a click of a button by pressing the ALT key in combination with the assigned access key. For example, if the underlined symbol is F, you should simulate pressing the ALT+F key combination (for detailed information about simulating keystrokes, see the Simulating Keystrokes topic)."
Related Content
- 2 years ago
- 4 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago