Ask a Question

Call REST API from TESTCOMPLETE

SOLVED
Emilija
Occasional Contributor

Call REST API from TESTCOMPLETE

Hi,

We are using TestComplete for Desktop (Version 12.60).

Now we should add API calls in some of our tests.

First, should we buy the web module too?

Does the Send Request operation work without the web module?

Thanks in advance!

5 REPLIES 5
hkim5
Staff

Hi,

 

The aqHttp object is included in TestComplete by default, and you can use this to make REST api calls as needed. https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqhttp/index.html

You will not need the web module to use this object.

 

With that said, you will not be able to create assertions or any other backend type of tests using this, but you will be able to view the http responses codes and bodies. 

Best,
Justin Kim
Emilija
Occasional Contributor

Thank you Justin.

I have created a send request item, but when I try to get token

I constantly get an error with code 400 saying 'invalid_client'

Do you have an idea what could be wrong?

 

 

Http 400 is just a general error thats generally due to invalid syntax.image.png

maybe if you share your code, the error logs, and what you're trying to achieve through these calls, some of the other members of the community more well versed in scripting/api requests can help you out! make sure to add some screenshots

Best,
Justin Kim

@Emilija :

Hi,

 

You may either ask your developers what this error might mean or use some recording proxy (Fiddler for example) to record the same request sent from some other tool (SoapUI, for example) when it succeeds and from TestComplete when it fails. Analyse the differences and try to eliminate them. (For example, some required header might be missed in the request sent from TC.)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
sonya_m
SmartBear Alumni (Retired)

Thank you everyone!

 

Hi @Emilija , was this solved for you? Please share your progress.


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: