wsExecuteRequest (wsCONNECT)
Compatible with:
- Purpose
- This command is the main command that is responsible for getting the URL identified by a wsSetRequestURL, executed by the appropriate wsCONNECT Tunnel operating on one of your company's servers (If the service under test is public facing, then invoking of the service is done from within the run)
- For services behind the firewall,Worksoft SaaS does NOT call the service from/on its cloud but sends the information to the appropriate wsCONNECT on your end along with the request parameters and the payload.
- When wsCONNECT Tunnel receives this execution request from Worksoft SaaS, in the context of a test being executed within your domain, wsCONNECT reads from ws .json (that drives your wsCONNECT tunnel) the base URL, authentication credentials to trigger the service call.
- Since it may take some time for the wsCONNECT and/or your service to respond, Worksoft SaaS waits asynchronously for the service result to be sent back from wsCONNECT.
- When the service provides a response, wsCONNECT sends the result set back to Worksoft SaaS, and the test that is executing in Worksoft SaaS, that was waiting for the execution results, proceeds with the test execution.
- If the response does NOT go back to Worksoft SaaS within the maximum time allowed for a query (as specified explicitly by the use of wsSetRequestTimeOut command or implicitly applied with a default value if that command is not used), the test that in Worksoft SaaS that was waiting for the results of the service call, will automatically abort the test.
- Syntax
- wsExecuteRequest(url_variable, variable)
- Target
- ${VariableName}
- The Value you specify here could be another variable within the Test Script or a User Defined Variable or a System Variable. The value of the variable should have been set using wsSetRequestURL command.
- Value
- ${VariableName}
- The Value you specify here could be another variable within the Test Script or a User Defined Variable or a System Variable
- Return Value
- Response from Rest service
Example(s):
Click here to see the example