Forum Discussion

user1's avatar
user1
Occasional Contributor
11 years ago
Solved

Need help in using global variable for the folder where the data file is located

Hi,

 

I am new to SoapUI. I have created one Testsuite (data driven) functional test suite and added some assertions and property transfer features.  I did not add any Groovy script. I had a datasource step where i selected the data file from a location on the local machine. I want to use Global variable so i can get the location from the global variable.

  • Define property name as master_directory and its value as C:\SoapUI\SoapUI-Pro-5.1.2.
    And it should be accessed as ${#Global#master_directory}

4 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    soapUI provides a common syntax to dynamically insert ("expand") property values during processing. The syntax is as follows:

    ${[scope]propertyName[#xpath-expression]}
    #Global# - references a global property. Found in File>Preferences>Global Properties tab. Reference properties across all projects
    For more details:
    http://www.soapui.org/scripting---properties/property-expansion.html
    • user1's avatar
      user1
      Occasional Contributor

      Thank you.

       

      Can you please check the syntax

       

      i have added the below property name and value  in File ->Preferences->Global Properties.

       

      ${#master_directory}  = C:\SoapUI\SoapUI-Pro-5.1.2

       

      i am using the above global variable in File textbox under Datasource configuration dialog

       

       ${#master_directory}/test.xls

       

      I get an error path not found.  Please let me know if the above usage is correct.

      • nmrao's avatar
        nmrao
        Community Hero
        Define property name as master_directory and its value as C:\SoapUI\SoapUI-Pro-5.1.2.
        And it should be accessed as ${#Global#master_directory}