cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipeline?

SOLVED
nish_b
Contributor

How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipeline?

Hi,

 

I have a Jenkins pipeline configured to run TestComplete scripts in a remote machine using TestExecute. I use JenkinsFile with Groovy to specify the command line arguments for the tests to be run. I do not have admin rights to the remote machine in which it is being run and the workspace gets wiped out for every new build.

 

My requirement is that in JenkinsFile I need to create a stage which gets executed post my scripts execution to send the exported HTML log file as an email. But the problem is that by default the value (file name with path) for /ExportLog is being taken by default.

 

So to be able to send the file, I want to read the value of command line parameter: /ExportLog . Is that possible? How can we achieve it? Please help!

 

Sample stage written for execution of test script:

 

stage ("Execute smartbear testcomplete test script") {
          testcompletetest executorType: 'TE',launchType: 'lcRoutine', project: 'Project1', routine: 'InitiateCmdLineExecution', suite: 'Project\\TestProject1.pjs', unit: 'Tests', 
			commandLineArguments : '/browser=chrome,/environment=env,/TestData=data,/TestName=Test1'
        }

 

1 ACCEPTED SOLUTION

Accepted Solutions
sonya_m
Community Manager

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Hi @nish_b ! I asked the team, here's what I got:
 
>> If I understand the user correctly, they just need to have exported log on Agent PC with a name which they know. TC allows specifying several /ExportLog keys.
So, the user can specify an additional key with a path which is defined
 commandLineArguments: '/ExportLog:"C:\\Temp\\33333.xml"'
and specify it for the email step.
 
Also, TC allows sending emails from the script code. The concept will be: save the log on disk, execute the code for sending the email. But this can be a bit more complicated.
<<
 
Please let me know if this is what you were looking for!

Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

6 REPLIES 6
nish_b
Contributor

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Anyone able to provide a solution please?

sonya_m
Community Manager

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Let's see if the Community can help!

 

@AlexKaras @anupamchampati @Marsha_R @tristaanogre any ideas?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Marsha_R
Community Hero

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Sorry, I'm no help when it comes to Jenkins.  

sonya_m
Community Manager

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Hi @nish_b ! I asked the team, here's what I got:
 
>> If I understand the user correctly, they just need to have exported log on Agent PC with a name which they know. TC allows specifying several /ExportLog keys.
So, the user can specify an additional key with a path which is defined
 commandLineArguments: '/ExportLog:"C:\\Temp\\33333.xml"'
and specify it for the email step.
 
Also, TC allows sending emails from the script code. The concept will be: save the log on disk, execute the code for sending the email. But this can be a bit more complicated.
<<
 
Please let me know if this is what you were looking for!

Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

nish_b
Contributor

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Hi Sonya,

 

Thanks for checking and getting back with the info.

 

I have another question - Is it possible for a PowerShell script to read the .tclogx file (TestComplete's output file). My requirement is to read the TestComplete test script execution log after script completes, read few details from the file and put those values in an excel file. Please provide your valuable suggestions.

TanyaYatskovska
Community Manager

Re: How to retrieve the value (filepath) given in /ExportLog command line parameter in Jenkins Pipel

Hi @nish_b,

It's great to hear that the original question was resolved. Let me mark the correct answer accordingly.

As for your second question - I recommend that you create a new topic for this question in the Community. I'm sure you will get the answers faster if you keep the rule: one question - one topic.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors