Forum Discussion

Simon_InT's avatar
Simon_InT
Contributor
7 years ago
Solved

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.html, 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?

  • 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.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

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

  • 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.