Forum Discussion

scambias's avatar
scambias
Contributor
8 years ago

Using vbscript constant as Operational Parameters when calling a "run script routine"

Hi,

 

I have written a vbscript function that uses one argument.

In order to simply the meaning of this argument, I created some vb constants (simulating a kind of enumerative behaviour).

I would like to use these constant when I insert a "run script routine" inside a Keyword Test, as argument for this function.

Is this possible somehow?

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What you would do is, when setting up the "Run Script Routine", in the parameter, select "Code Expression" and then just enter the constant in the format of "UNIT.VARIABLE".

     

    • scambias's avatar
      scambias
      Contributor

      Hi Robert,

       

      Thank you for your answer.

      I tried to, but it seems not to be working. What I get is an argument with "undefined" value.

       

      By the way I tried also from a vbunit A to use a variabile myVar defined in unit B, by accessing with name B.myVar and it works.

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Can you post your code where you're creating these constants and then post a screenshot showing how you're attempting to use them in a Keyword test?