Forum Discussion

yuchang's avatar
yuchang
Contributor
11 years ago

How to create a simple data file for testing input?

In script, it needs to fill in data into different inputs of web.

What and how to creat a file which collects the data working as variables for scripts?

For example, in JScript a variable lanaguages:



var languages = new Array("AR", "CS", "EN");



How/where to put this array in a separated file that a script or keyword test can access it?

Currently, I insert this array into a script and the script make is as a global project variable for the keyword test can access it.

Is there a better way to do that?

1 Reply

  • I found a way to create a script for storing variables:



    1. Create a script which define the variable as

        var languages = new Array("AR", "CS", "EN");

    2. Add Unit References of the script created in the step 1 to the script which uses the variable.

    3. In the script which uses the variable declare:

        var var1 = dataInput["languages"]

    4. The second script can access languages via var1.



    Please advise and provide more standard/flexible way to do that.