Forum Discussion

ryanterronez's avatar
ryanterronez
Occasional Contributor
6 years ago

Parameter or Variable

I am fairly new to Testcomplete and QA testing in general.  I am using multiple variables in my tests: tables, passwords, strings...and I am wondering what the difference between a parameter and a va...
  • LinoTadros's avatar
    6 years ago

    Hi Ryan

     

    Think of a variable as something you would like to keep around as a value to use or reuse during the execution of your code.  Paramater is something that you would like to pass to another function during the execution.

     

    For example:

    var x ="Lino";  //That creates a new variable and assigns it the value of "Lino" in order for you to use that value whenever you want to.  

    var x = foo( ); //here you are calling a function called foo that returns a value and you are saving that value to the variable X.

     

    function foo( url ) { } //here url is a parameter, that means that function foo can not be called unless you pass a value to the function as a parameter.  So later on, in another function, i can call it by saying:

    foo( "http://www.smartbear.com");

    //here the function foo will be called passing a parameter of the value of the url you want to use.

     

    Hope that makes sense.

    Cheers

    -Lino