Parameterizing REST request from TestComplete
As part of my TestComplete test suite, I want to be able to make REST requests to avoid unecessary UI interaction. I have managed to get a REST request working using the SOAPUI intergration. However what I want to be able to do is pass values to this REST request from the tests in TestComplete.
As an example I have the following json in the body of a SOAPUI REST request:
{"username":"${#Project#username}","password":"${#Project#password}"}
This allows me to change the project properties for the username and password that will be used as part of the login request. In TestComplete I can then change the project properties of the API call once I have added it to the TestComplete project. Ideally I don't want to have to set these as project properties in order to change their value. I want to be able to take values from the output of a keyword test or script, and use those values in the REST request when it makes the call. Is this possible and what is the best approach for this?
Hi,
Did I get you right that you are using SoapUI integration in your TestComplete project, execute some SoapUI test from within your TestComplete test and want to pass parameters from TestComplete test to SoapUI one?
If the above is correct, than that close integration is not supported by TestComplete (yet?). I think that the only posible approach in this case is to store parameters in some intermediate file in TestComplete test and read the content of this file and assign the proper values to the relevant variables in SoapUI. To implement this in SoapUI, you may either create a startup script or add an additional step to the test.
P.S. Alternative approach is to send REST request directly from TestComplete test (using, for example, http://community.smartbear.com/t5/Functional-Web-Testing/TestComplete-support-for-automating-REST-API/td-p/110066 thread as a sample).