Ask a Question

Using a test Parameter as part of a code expression value

SOLVED
RUDOLF_BOTHMA
Community Hero

Using a test Parameter as part of a code expression value

Afternoon all !

 

Today is just a thought on whether there is a cleaner way...

 

I want to call a script inside my KWT.  It takes an array of strings.  Each one of the elements comes from a seperate test parameter.  Is there a method to use a parameter directly in a code expression or will I have to set up a variable for each parameter, assign the variable then use the variables in my code expression ? 

 

Just for interest sake.  This is what the KWT does and why an array is preferable

 

I have a KWT that takes 16 parameters.  Each one of these parameters is used to set the text of a specific control on the page.  I also have a script that takes an array of values which it can loop through and use to populate the relevant controls.  There is a good reason you would want to do that.  Due to the page structure, finding a combobox takes quite some time.  Each time I want to put data in, it takes 5 seconds, so 80 seconds to enter one row of data.  I can't use name mapping, which admittedly will be faster, since it's a grid which has an unknown number of rows.  Also,any of the rows can currently be editing.  Perhaps row 50? I'm not mapping 50 rows individually Smiley Frustrated  If, however I send an array and which row I 'm editing as parameters, the script gets the container and can, inside of this container object, search for one control at a time using .Find, regexp etc. and set it.  So, 4 seconds to find the container, 1 second per combobox = 20 seconds.  One minute saved per KWT run.  Kerching!  I will only have to run the KWT 1500 times to make back the time I spent writing the script Smiley Tongue


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
2 REPLIES 2
tristaanogre
Esteemed Contributor

Let's say your keyword test is named MyTest

 

So, to use a parameter in a code expression, you'd call

 

KeywordTests.MyTest.Parameters.MyParam


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Just what I was looking for, thanks


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
cancel
Showing results for 
Search instead for 
Did you mean: