cancel
Showing results for 
Search instead for 
Did you mean: 

How to refer to array created in ScriptSetup?

SOLVED
Highlighted
Contributor

How to refer to array created in ScriptSetup?

I have created variables containing data in ScriptSetup at the test suite level. I would like to refer to these variables from a Rest step body. How can I do that. I have tried the following format/syntax and it did not work.

ex:

in the ScriptSetup

variable  = globalDateTimevalue[]

 

in the Rest step body I try:

${globalDateTimevalue[]}

or

${#globalDateTimevalue[]}

 

Thanks a lot in advance.

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How to refer to array created in ScriptSetup?

You can use context and set your property and access the same wherever you need.
However, this works only if you run whole suite.

There is sample project done sometime ago, please have a look
https://github.com/nmrao/sample-soapui-projects/tree/master/data-access


Regards,
Rao.

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: How to refer to array created in ScriptSetup?

You can use context and set your property and access the same wherever you need.
However, this works only if you run whole suite.

There is sample project done sometime ago, please have a look
https://github.com/nmrao/sample-soapui-projects/tree/master/data-access


Regards,
Rao.

View solution in original post

Highlighted
Contributor

Re: How to refer to array created in ScriptSetup?

Thanks , sorry I am not sure I follow here.

So you mean I could write the array in a property like this:

context.setProperty("testArray[]", globalDateTimevalue[])  

and then call it in this way:

context.testArray[]

?

 

Highlighted
Contributor

Re: How to refer to array created in ScriptSetup?

Thanks a lot , I think I forget the "However, this works only if you run whole suite". It works now Smiley Happy