Forum Discussion

nish_b's avatar
nish_b
Contributor
4 years ago

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'
        }

 

  • sonya_m's avatar
    sonya_m
    4 years ago
    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!