cancel
Showing results for 
Search instead for 
Did you mean: 

To get URL of TestComplete Test Results of a Jenkins Build

SOLVED
SaravanaKumar_N
Contributor

To get URL of TestComplete Test Results of a Jenkins Build

Hi All,

 

I would like to know is there any way in Jenkins to get the URL of TestComplete Test Results.

My requirement is, once the build is completed, I have to send the email with the link of TestComplete Test Results.

As shown in the attachment, I can get the URL of 'image-1' but I would like to get the URL of 'image-2'.Capture.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

There could be some jenkins manager build API, that I might not aware of. Any help on this please.

 

Thanks,

Saravana

 

1 ACCEPTED SOLUTION

Accepted Solutions
SaravanaKumar_N
Contributor

Re: To get URL of TestComplete Test Results of a Jenkins Build

Thank you @Marsha_R.

 

I saw that, there was a tag - url, which could be the one I needed. Bur I faced SSLHandshakeException, when parsing the XML file. Of course we could handle it through System admin.

But instead I took other option - that to find the random number generated for .mht file by the TestComplete plugin. It was available under the Jenkins Home directory.

 

Following is what I have done to find that and get the URL I needed.

 

// Frame the Job Path and find the .mht file name
def jobPath = "${manager.build.getEnvironment(manager.listener)['JENKINS_HOME']}/Jobs/${manager.build.getEnvironment(manager.listener)['JOB_NAME']}/builds/${manager.build.getEnvironment(manager.listener)['BUILD_ID']}/tcreports/";

// Find the .mht file name

def fileName = "";
def files = [];
new File(jobPath).eachFileMatch(~/.*.mht/) { files << it.name }
fileName = files[0];

// Frame the Report URL
def url= Jenkins.instance.getRootUrl() + manager.build.getUrl() + "TestComplete/dynamic/" + fileName.replaceAll(".mht", "") + "/#";

View solution in original post

2 REPLIES 2
Marsha_R
Community Hero

Re: To get URL of TestComplete Test Results of a Jenkins Build

The API to get test results is mentioned at the bottom of this article:

 

https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/viewing-test-result...

SaravanaKumar_N
Contributor

Re: To get URL of TestComplete Test Results of a Jenkins Build

Thank you @Marsha_R.

 

I saw that, there was a tag - url, which could be the one I needed. Bur I faced SSLHandshakeException, when parsing the XML file. Of course we could handle it through System admin.

But instead I took other option - that to find the random number generated for .mht file by the TestComplete plugin. It was available under the Jenkins Home directory.

 

Following is what I have done to find that and get the URL I needed.

 

// Frame the Job Path and find the .mht file name
def jobPath = "${manager.build.getEnvironment(manager.listener)['JENKINS_HOME']}/Jobs/${manager.build.getEnvironment(manager.listener)['JOB_NAME']}/builds/${manager.build.getEnvironment(manager.listener)['BUILD_ID']}/tcreports/";

// Find the .mht file name

def fileName = "";
def files = [];
new File(jobPath).eachFileMatch(~/.*.mht/) { files << it.name }
fileName = files[0];

// Frame the Report URL
def url= Jenkins.instance.getRootUrl() + manager.build.getUrl() + "TestComplete/dynamic/" + fileName.replaceAll(".mht", "") + "/#";

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors