Forum Discussion

Josh_147's avatar
Josh_147
Contributor
5 years ago

How to use Test Engine REST API in third party tool?

Hi all,

 

I'm trying to create a tool by myself and simulate some user action (Click, ClickR, ClickItem, SetText, etc..) on an application by calling the API. Based on the documentation, it stated that Enables you to access the test engine from third-party tools. You can access tested applications, their objects, properties and methods, and simulate user actions on the tested applications.

 

I'm not sure how to use the Test Engine REST API as there are not much reference or example explain about how to use the API with third party tool. Is the API works like what I would like to do?

 

Thanks.

  • Hi,

     

    What is your final goal?

     

    The help article that you referenced and quoted relates to Test Engine REST API. And the corresponding article (https://support.smartbear.com/testcomplete/docs/reference/apis/test-engine.html) says that Test Engine REST API is mostly used by Test Left. But when Test Left is installed, special edition of TestExecute (which is runtime engine for TestComplete) is installed as well and it is TestExecute that does the actual job.

    The above means that you will not be able to create your custom program that can drive your tested application via Test Engine REST API, but TestExecute (or TestComplete) will be required nevertheless.

    All this makes me to repeat my initial question and wonder what functionality you are missing in TestComplete that forces you to create your custom test driver application (that still requires TestComplete/TestExecute to be installed on the test box)?

     

    • Josh_147's avatar
      Josh_147
      Contributor

      Yes but I'm not sure how to implement the API. Also, it stated that simulate user actions on the tested applications but from the API list operation, I can't find any API that is related to simulate user actions. Am I missing out something?

       

      One more question is: When TestComplete is running / recording, can we use the API at the same time?

       

      Thanks.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    What is your final goal?

     

    The help article that you referenced and quoted relates to Test Engine REST API. And the corresponding article (https://support.smartbear.com/testcomplete/docs/reference/apis/test-engine.html) says that Test Engine REST API is mostly used by Test Left. But when Test Left is installed, special edition of TestExecute (which is runtime engine for TestComplete) is installed as well and it is TestExecute that does the actual job.

    The above means that you will not be able to create your custom program that can drive your tested application via Test Engine REST API, but TestExecute (or TestComplete) will be required nevertheless.

    All this makes me to repeat my initial question and wonder what functionality you are missing in TestComplete that forces you to create your custom test driver application (that still requires TestComplete/TestExecute to be installed on the test box)?

     

    • Josh_147's avatar
      Josh_147
      Contributor

      Hi AlexKaras ,

       

      Thanks for the explanation regarding the Test Engine REST API. I'm trying to create a tool which is able to perform user action automatically while at the same time, TestComplete is recording. Since the TestComplete is not able to run and record at the same time, therefore I'm trying to use the API. So, my final goal is to find a way that can create the test cases automatically.

       

      Or maybe it can be a new feature for TestComplete? Able to run script and recording at the same time.

       

      Thanks.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        I'm trying to create a tool [...]

        I am afraid that you will not be able to get this... The reason is that TestComplete is a single-threaded single-instance application but your scenario assumes two instances of engine to be running: one for recording and one for driving tested application.

        You may try to get what you are talking about with the help of some other tool, like AutoIt, for example. AutoIt will drive your application while TestComplete will record. No need for any API. (However, in order to get a more or less good and reusable recording, it is highly recommended to create a proper NameMapping in TestComplete before recording.)

        I hardly see the reason to make TestComplete to be able to run the script and record at the same time - if you already have the script, what is the reason to record it?

        Did I miss something in your explanation?

         

        > One more question is: When TestComplete is running / recording, can we use the API at the same time?

        No. API documentation explicitly states that one must wait until test run is over and only then continue to use API.