Ask a Question

TestComplete with Maven and Jenkins

tarunaggarwal23
New Contributor

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.

5 REPLIES 5
hkim5
Staff

Re: TestComplete with Maven and Jenkins

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

Best,
Justin Kim
hkim5
Staff

Re: TestComplete with Maven and Jenkins

hkim5_0-1608749342211.pnghkim5_1-1608749367211.png

 

Best,
Justin Kim
tarunaggarwal23
New Contributor

Re: TestComplete with Maven and Jenkins

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=testcomplet...

 

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
Occasional Visitor

Re: TestComplete with Maven and Jenkins

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

tarunaggarwal23
New Contributor

Re: TestComplete with Maven and Jenkins

Hi,

 

I noticed that when I use SessionCreator.exe directly from Jenkins (From Windows Batch command in Jenkins), I am able to make the connection and the test complete script runs fine.

 

If I call SessionCreator.exe from JAVA program using ProcessBuilder and call the JAVA program using mvn from Jenkins, the command executes, but nothing happens on the screen. When I see the TestComplete Logs, I see complete white picture in the screenshots.

 

I think the problem is somewhere in the way Jenkins service is running. I have tried running the Jenkins service as Local System Account with 'Allow service to interact with desktop' checked as well as the actual domain user with which i am logged into the system.

 

Any suggestions to make this work?

 

Thanks,

Tarun

cancel
Showing results for 
Search instead for 
Did you mean: