zerocode
zerocode copied to clipboard
Variable section for Zerocode DSL
trafficstars
As an automation test engineer I want a port number or a random number or a random string or all of them to be available to my steps inside a single scenario So that I will be able to reuse this in my steps easily.
Is this already available... by chance?
An example would look like below:
{
"name":"vars",
"port":8090,
"employeeName":"Joe Tidd",
}
In the next step or in any subsequent steps:
{
"url": "http://hbc.api.github.com:${vars.port}/api/v1/employees",
"method": "POST",
"request": {
"body":{
"name": "${vars.employeeName}"
}
},
"verify":{
"status": 201
}
}
In next step e.g.:
{
"url": "http://hbc.api.github.com:${vars.port}/api/v1/employees/${vars.employeeName}",
"method": "GET",
"request": {
},
"verify":{
"status": 200,
"body":{
"name": "${vars.employeeName}"
}
}
}
@siddhagalaxy , the parameterized should help you to achieve this. However they are not named as you have requested.
We will try to implement the above (might be with some refinements/suggestions from the other collaborators).
The below section can be kept outside the steps at the same level as scenario.
{
"name":"vars",
"port":8090,
"employeeName":"Joe Tidd",
}