Forum Discussion
Just to clarify, you essentially want to do a for loop through around your code where you would use the index of the for loop within the name of the data record, yes?
So...do a for loop. :)
https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/statements/for-loop.html
There are code analogues in keyword tests to do what you want. So, for loops, while loops, etc., are present and available.
As for the second part of your question, what I would do is use the "Run Script Routine" operation that runs your Python function that returns the value. Then, in that SetText field, click the ellipses button. In the resulting screen, in the drop down that probably currently says "Variable", change that to "Last Operation Result". That will take the value returned from your function and put it in the SetText field.
So many questions. The documentation does a great job of explaining "why", but not "how".
How do I use the "Run Script Routine" operation?
How do I tell SmartBear that my script is Python?
- tristaanogre8 years agoEsteemed Contributor
To answer your second question first, when you created your automation project, you were prompted to select a scripting language. If you selected Python then the assumption, even in Keyword tests, is that the syntax of everything is Python.
As for how to use the "Run Script Routine", drag the operation over into your keyword test and let the wizard do it's work. :) Basically, you'll be prompted first to select the code unit and then the script routine to execute, if the script routine has parameters, you'll be prompted to provide them as values. Honestly, it's really that simple. :)- MrDysprosium8 years agoContributor
>Honestly, it's really that simple.
simplicity != intuitive- MrDysprosium8 years agoContributor
I promise I'm not trying to be dense... I'm not sure I understand your terminology, and I'm obviously doing something wrong.
Here's my attempt to follow your instructions.
- tristaanogre8 years agoEsteemed Contributor
If you haven't done so yet, I'd highly recommend registering for and participating in the monthly TestComplete 101 webinars. For someone JUST getting started with the tool, they are HIGHLY valuable. You can watch the recording of one of the recent ones at
https://support.smartbear.com/testcomplete/videos/smartbear-academy-test-complete-101-trainingHere's the link for registration.
https://support.smartbear.com/testcomplete/training/free-training/
- tristaanogre8 years agoEsteemed Contributor
There are also tutorials built into the Help system in TestComplete. I'd strongly recommend walking through a couple of those just to get a feel of the tool and how it operates.
Of course, we're always here at this community to answer questions. Feel free to ask away. :)
Related Content
- 3 years agoariyan_79
- 4 years agospacelight