How to access a property variable in a Rest Client URL
I want to access a variable like &{test_env} in a url while doing a GET in a Rest Client Test. The url would look like https://mysite.${test_env}.com where test_env is a property which was created in a parent test suite using context.put("test_env", testEnv). I am including a .tst file that reads an excel spreadsheet in a parent test suite test that uses an Extension Tool (using groovy). It then proves in a couple of other Extension Tools that it can get the property and stores it in a variable and uses the variable in an interpolated string. I then go to the child test suite and try to use the property as a variable like ${test_env} and I have no clue on how to access the variable. I tried in a Test Rest Client but it does not know the variable exists. Any help is apprectiated. I just tried to add the .tst file and the site would not let me using the attach file.
Comments
-
I would create a test suite variable, and then set that in your Extension Tool. You can then reference the test suite variable using the ${var} syntax.
0 -
Thanks for the feedback. Can I read a file and update test suite variables?
0 -
I assume you are asking if you can read a file and update test suite variables in your script? Sure - since it's a scripting language you can do almost anything!
0