jenkins pipeline catch the exit code 0
Hello, I need you're help, i am using Testcomplete 15 and TestExecute 15 with jenkins With jenkins pipeline def RunTest(String TestInfos) { try { testcompletetest actionOnErrors: 'MAKE_FAILED', actionOnWarnings: 'MAKE_UNSTABLE', credentialsId: 'VEGA-TEST', executorType: 'TE', launchType: 'lcItem', project: 'Macro_Standard_Beta', sessionScreenResolution: '1920x1080', suite: 'Alocpro\\Alocpro.pjs', useTCService: true, test: "$TestInfos" stageResult = 'SUCCESS' echo "< Build SUCESS >" } catch (Exception e) { catchError(stageResult: 'FAILURE') { sh "exit 1" } echo "< Build Failed >" } } pipeline { agent { label 'Srv-Test01' } options { timeout(time: 1, unit: 'HOURS') } stages { stage('Reset BDD Beta') { steps { script{ RunTest('Beta_02_Reset_BDD') } } } stage('CartesCarburant') { steps { RunTest('Avancee1|Beta_2_01_CartesCarburant1') } } stage('Contentieux') { steps { RunTest('Avancee1|Beta_2_02_Contentieux') } } stage('Contraintes') { steps { RunTest('Avancee1|Beta_2_03_Contraintes') } } /* stage('CRM') { steps { RunTest('Avancee1|Beta_2_04_CRM') } } stage('EtatStatistique') { steps { RunTest('Avancee1|Beta_2_05_1_EtatStatistique') } }*/ stage('Financement') { steps { RunTest('Avancee1|Beta_2_06_Financement') } } stage('Comptabilite') { steps { RunTest('Avancee1|Beta_2_07_0_Comptabilite') } } stage('Assurance') { steps { RunTest('Avancee1|Beta_2_08_Assurance') } } stage('GestionDesPetroliers') { steps { RunTest('Avancee1|Beta_2_09_GestionDesPetroliers') } } stage('Prestation') { steps { RunTest('Avancee1|Beta_2_10_Prestation') } } } post { failure { emailext body: '''$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS : \n $BUILD_LOG maxLines=8000, escapeHtml=true \n \n Check console output at $BUILD_URL to view the results.''', recipientProviders: [brokenBuildSuspects()], from: '##', subject: 'Build failed in jenkins : $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: '##', attachLog: true } unstable { emailext body: '''Build unstable - $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS : unstable\n $BUILD_LOG maxLines=8000, escapeHtml=true \n \n Check console output at $BUILD_URL to view the results.''', recipientProviders: [brokenBuildSuspects()], from: '##', subject: 'Build instable in jenkins : $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: '##', attachLog: true } fixed { emailext body: '''$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS : Back to normal !\n Check console output at $BUILD_URL to view the results.''', recipientProviders: [brokenBuildSuspects()], from: '##', subject: 'Build back to normal : $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: '##' } } } The jenkinspipeline works, but in my jenkins view i dont have my stage in red when it failed. What i would like to do is to catch the exit code =! 0 and setstageResult = 'FAILURE' But the other stages needs to continue even if one of them failed there are independent I have triedcatchError steps but this is not really what i want. In this exemple the try catch does nothing even if a test crashed because of the exit code which seems not to be handled in jenkins this way The error i did in this scenario is in purpose to test the exitcode I have linked a log of the lastest execution i did >logs jenkins.txt Is there a way to catch the exitcode in jenkins? Thanks6.5KViews0likes0Comments[TechCorner Challenge #1] Passing custom command-line arguments as test parameter
Hi Community! This resource we are creating together has gained so much value over the years. Tons of helpful content can be found in the TestComplete Community thanks to all of you! I propose that we take it to the next level by adding even more useful things to the TechCorner tag - a tag where we keep your tech articles, script examples, use cases, etc. Here's your chance to share expertise and contribute. Task:Write a script that will take the value of a custom argument from the TC command line and use this value to run a parameterized test. Difficulty: For example, imagine that you have a web test that takes the name of the browser as a parameter. The script should check the command line TC was launched with, find the /BrowserName parameter, read its value, and pass it to the web test as a parameter. If the command line contains /BrowserName=chrome, the web test should launch Chrome; for /BrowserName=firefox the web test should launch Firefox, etc. Good luck!Solved5.3KViews3likes7CommentsTestComplete command line problems
I have written come python scripts to call TestComplete as a part of the CI system I am building. I then installed Test Complete on a remote machine and am having problems understanding why TestComplete is trying to open TestComplete.exe. Is this a bug or am I just missing something obivious? I never encourtered this on my local machine.Solved4.3KViews0likes14CommentsCommand Line and Collapsible Script Methods
Request 1: As of now, I have faced problems in passing variables from command line to TestComplete. So, if I would like to have a single suite, working for different regions/environments, and execute themfrom command line, I don't get an option to pass PARAMETERS to my Project or Project Suite. Consider having to work on 5 environments. When i evoke TC execution, I would like to pass arguments to my Project/Project Suite (can be said as Project or Project Suite Test Parameters). This will ease my work in simply passing my arguments for environments and other static data, which will accordingly execute my scripts with the correct configurations. Request 2: Another request, which I would want across all automation tools - Give a feature to collapse methods. It's quite tiring to go through the our scripts to find a method. I know, we can find it using the drop down, but it's not always that easy - It's hard to move up and down, with that much of code on the block. A similar approach like we have in Visual Studio - the ease of programming and maintenance just gets better.4.1KViews1like2CommentsTestExecute 10 - Can't run /SilentMode from CMD
I created a very simple project that opens Windows Calculator and closes it. It is bound to Source Control Perforce P4V. I can run it in CMD without /SilentMode, but not with /SilentMode. When I call TestExecute, it doesn't load in Task Manager Processes. Am I missing something? [Please see attached screenshot.] The project runs fine in TC10 and FinalBuilder7.Solved4.1KViews0likes5CommentsOpen file Security - Warning Popup
Hi, How can we handle these "Open file Security - Warning" popups in Testcomplete14. How can I click on the Run button? While accessing the desktop application I am getting this popup. I can able to map those buttons 'Run' and 'Cancel' but during the Test Execution the script is failing.Solved4.1KViews0likes11Comments.exe file run in test execute
Hi, Is it possible to convert the project suite(with project scripts, keywords) into binary executable? And run in Test Execute Tool. Since, Test execute support file format -> .pjs and .mds. Does the Extensions(has installed with .net framework) will run .exe file? (Note: Test Execute providing .Net Framework->so, Can we run .exe file)Solved4KViews0likes14CommentsStarting Testexecute with powershell hanging process windows update 1803
Hey, I encounter a problem using testexecute after an update of windows Problem: The process TestExeute.exe keeps runnning after the test has finished. The powershell script that is waiting for the process to finish never continues and gets stuck. The test is started on a windows 10 (build 17134) machine with TestExecute 11 on itusing the following command: Start-Process "C:\Program Files (x86)\SmartBear\TestExecute 11\Bin\TestExecute.exe" -ArgumentList '"C:\PAthToTestPRoject\TestProject TEST.pjs" /project:"TestProject TEST" /test:"Script|TestCentrum|TestCentrum_Main" /r /e /SilentMode /ForceConversion' This script has worked until we installed the windows update 1803. After rebooting the virtual machine and starting an instance of testcomplete or testexecute a edge browser would start. I followed the advice on the forum to not enable support for microsoft store apps. the Edge browser didn't start anymore but the TestExecute process still didn't always close at the end of the test. What I have found so far: I found a process cftmon.exe that when I analyse the wait chain it's waiting for the testeExecute proces. in the testexecute proces it says it's waiting for cftmon.exe. when I kill the cftmon.exe process it restarts immidiatly and the testexecute process is closed.3.3KViews0likes7CommentsIntegrate TestComplete Tests into Gitlab CI/CD Pipeline
I am trying to integrate my TestComplete Tests into the Gitlab CI/CD Pipeline, using the Gitlab Runner which runs tests on my remote machine. I understand that in order for TestComplete tests to be executed, an active user session is required to be present. I tried to use the SessionCreater Utility to circumvent this problem, yet I can't seem to get my tests to run on Gitlab. Does anyone have any experiences with integrating TestComplete tests into the Gitlab CI/CD Pipeline using the Gitlab Runner? Is it even possible to do so? Thank you!Solved3.2KViews0likes3Comments