Forum Discussion

tarunaggarwal23's avatar
tarunaggarwal23
Occasional Contributor
4 years ago

TestComplete with Maven and Jenkins

Hi, 

 

We have a peculiar requirement. We have a proprietary 3rd party backend system where we have to publish certain records before the application processes it and displays some popups on the UI which we have to validate from TestComplete. There are no direct APIs to place the records in the backend system. So, we have written a Java program that does it for us. Since the starting point for us is a Java program we have designed this flow:

 

  1. We are using Java-Cucumber and in the background step, we connect to the backend system
  2. In every test case step, we publish the required record using Java code
  3. From the Cucumber test step itself, we invoke TestComplete functions and do the validations on the UI. We do it using Socket Programming.
  4. Finally, we integrated all this together and run it using the maven command

All the above flow is working fine if we run the tests on the development machine. But, we want to integrate this automation with Jenkins and run the automation on a Jenkins VM client machine. Since the starting point is not TestComplete but JAVA / Maven for us, we cannot use the TestComplete plugin.

 

Can anyone please suggest how we can integrate the above flow with Jenkins? Any ideas if there is a way to specify "UseInteractiveSession" ,"Credentials", "screen resolution" parameters from TestExecute command line.

  • i dont understand why you cannot use the plugin...

    say you first build your maven project as the first build step of your pipeline, you can easily add it post steps (one of which could be the testcomplete plugin)

    when you are performing these tests are a dev machine, I'm assuming someone manually kicks off this sequence?

    If you then apply the first step (mvn test) into the jenkins pipeline, and add the testcomplete test as a post step are you seeing failures?

    Worst case scenario, you could chain batch commands using the SessionCreator.exe (utility shipped with testcomplete) in order to start up an interactive user session and specify the TC project to run

      • tarunaggarwal23's avatar
        tarunaggarwal23
        Occasional Contributor

        Thanks hkim5 for your response.

         

        The flow of all my testcases is like this:

        1. Publish a record using JAVA
        2. Once the Popup comes on the screen, validate the UI using TestComplete
        3. Validate any changes on the backend record again using JAVA

        Since the starting point of each test case is Java and not TestComplete; that is why I can't use the Jenkins TestComplete plugin. Neither I can place all the records in one go using Maven command and then call the TestComplete scripts in one go to verify the UI. Its Java-TestComplete mixed flow for every test case.

         

        In my case it is the Maven project (JAVA) that internally launches TestComplete using Socket Programming (https://smartbear-cc.force.com/portal/KbArticleViewer?name=Script-based-TCP-IP-server&sp=testcomplete).

         

        My Java Program calls TestComplete TestExecute like tthis:

        driverProcess = new ProcessBuilder(
        testCompletePath,
        driverInvocationProjectPath,
        "/run",
        "/project:" + driverInvocationProjectName,
        "/u:" + driverInvocationFileName,
        "/rt:" + driverInvocationFunctionName,
        "/ns",
        "/ErrorLog:" + errorLogFilePath,
        driverInvocationCustomParams
        ).start();

         

        Yes I am manually running the tests on a dev machine.


        I need a way that from Java Program, I can specify "UseActiveSession" and Credentials. Right now when i run the automation from Jenkins, the script starts but since the automation runs under Service Account everything on the screen is white (Application is not visible on the UI).

  • LasVegas's avatar
    LasVegas
    Occasional Visitor

    We use TestComplete as testing framework and our testers has written a number of scripts for testing. The idea is to run this scripts during the night build, which is executed as maven script. Has someone succeeded to combine these two technologies?

     

     

     

     

     

    myprepaidcenter