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.
- MrDysprosium8 years agoContributor
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
Related Content
- 3 years agoariyan_79
- 4 years agospacelight