Ask a Question

How to add a test item parameter to a scripted test

SOLVED
Simon_InT
Contributor

How to add a test item parameter to a scripted test

I'm wanting to perform some multi-browser testing within my test scripts. As per https://support.smartbear.com/testcomplete/docs/app-testing/web/general/cross-browser/parameterizing..., I want to add a browser parameter to a test item. However when I click on the parameter cell there is no ellipsis button to add a new one. When I type it in manually the text gets cleared as soon as I hit Enter.

 

Therefore can anyone tell me how to add a test item parameter to a scripted test? I can find help on how to add it to a keyword test, but not for a scripted test. Is it even possible?

1 ACCEPTED SOLUTION

Accepted Solutions
tristaanogre
Community Hero

Re: How to add a test item parameter to a scripted test

This is JavaScript...

This is a "scripted test" without a parameter

 

function Test(){

   DoSomething();
}

This is a "scripted test" with a parameter

 

function Test(parameter1){

   DoSomething();
}

So... before you can send a parameter to your TestItem, you need to add the parameter to your script code.  Once you do that, then you SHOULD be able to access the parameter settings of your Test Item.


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

View solution in original post

3 REPLIES 3
Marsha_R
Community Hero

Re: How to add a test item parameter to a scripted test

I clicked on your link and scrolled about halfway down on that page and found this.  Is this what you're looking for?script.PNG

Simon_InT
Contributor

Re: How to add a test item parameter to a scripted test

I've worked this one out.

 

I can add a test item parameter only if the method I'm calling in this test item has a parameter. Now that I've added a parameter I now have the option of adding a value within the test item parameter.

tristaanogre
Community Hero

Re: How to add a test item parameter to a scripted test

This is JavaScript...

This is a "scripted test" without a parameter

 

function Test(){

   DoSomething();
}

This is a "scripted test" with a parameter

 

function Test(parameter1){

   DoSomething();
}

So... before you can send a parameter to your TestItem, you need to add the parameter to your script code.  Once you do that, then you SHOULD be able to access the parameter settings of your Test Item.


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

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: