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.5KViews0likes0CommentsRead excel data/links in javascript test complete
Hi team, I have tried to read the data file using javascript in test complete.But shows error as "Type error: cannot read the property 'SheetByTitle' of null" functionExcelRead() { varexcelFile = Excel.Open("C:\\temp\\DataStorageExcel.xlsx"); varexcelSheet = excelFile.SheetByTitle("Sheet1"); varvalueA = excelSheet.Cell("A", 3).Value; varvalueB = excelSheet.Cell(2, 3).Value; varvalueC = excelSheet.CellByName("C3").Value; } Can any one help regarding this issue or I want to fetch the weblinks from excel file one by one that links need to execute. Thanks in advance.Solved5.4KViews0likes4CommentsClickItem select another Option
Hi all, in a script test I'm trying to select a Select Option with the ClickItem function but TestComplete select the Option that is ten positions above the desired one. The script portion is: selectElement.scrollIntoView(); selectElement.clickItem(elementName); The HTML code is <select _ngcontent-yqp-c115="" class="form-select form-select-sm select-dark ng-pristine ng-valid ng-touched" id="id-3"> ... <option _ngcontent-yqp-c115="" id="idOpt-3-24" value="16: 24"> <span _ngcontent-yqp-c115="" class="select-option-dark"> Bahamas </span> </option> ... <option _ngcontent-yqp-c115="" id="idOpt-3-34" value="26: 34"> <span _ngcontent-yqp-c115="" class="select-option-dark"> Bolivia </span> </option> ... </select> During the test execution the mouse pointer correctly select the Option desired but when the panel of the select is closed the item selected result the wrong item. I do this two times in a script on two long Select and I have the same behaviour. Why does this happen? Thanks LorenzoSolved5.3KViews0likes11CommentsTrying to call the FindChild method or property of an object but it does not exist
Hello, can someone help debug the following script, I cannot figure it out why it's failing being I am new to TC. I included the screenshot of the properties from the Spy captured,I am sure the page ID is correct according to the spy screen. function DragCard() { // Find the first column element var column1 = Sys.Browser("chrome").Page("https://rdx-dev.rdxhub.com/workspace/patient-board").FindChild("idStr", "chk-drop-list-0", 10); // Find the card element in the first column with the desired text content var cardToMove = column1.FindChild("contentText", "Test Patient455", 10); // Find the second column element var column2 = Sys.Browser("chrome").Page("https://rdx-dev.rdxhub.com/workspace/patient-board").FindChild("idStr", "chk-drop-list-2", 10); // Drag the card to the second column cardToMove.Drag(column2); }Solved5KViews0likes12CommentsCopy and rename a file using JavaScript
Hello, I am trying to copy an xml file, and rename it so I can use it in my tests. Only I can't seem to figure out what I am doing wrong. I used the TestComplete documentation, as I got the code from there. I tried to modify it in different ways, but nu success. This is the code I currently have: aqFile.Copy("\\bs-international.nl\group\ICT\Applicatiebeheer\TestComplete\NewPackingTable xml files\NewPackingTable_BIT-ERP_Order.xml", "\\bs-international.nl\group\ICT\Applicatiebeheer\TestComplete\NewPackingTable xml files\NewPackingTable_BIT-ERP_Order-copy.xml"); function RenameXMLFile() { var OldPath = "\\bs-international.nl\group\ICT\Applicatiebeheer\TestComplete\NewPackingTable xml files\NewPackingTable_BIT-ERP_Order-copy.xml"; var NewPath = "\\bs-international.nl\group\ICT\Applicatiebeheer\TestComplete\NewPackingTable xml files\NewPackingTable_BIT-ERP_Order- "+ VarToStr(aqDateTime.Now())+ ".xml"; // Renames the file aqFileSystem.RenameFile(OldPath, NewPath); } I hope someone can help me get back on track.Solved4.2KViews0likes8CommentsThe current row position is already beyond the table
Hi all, im ecountering a very weird error when im running my execution plan. I have a test that will return this error : The current row position is already beyond the table The error is returned at the very end of my keyword test and the last script executed seems to have run successfully. I have also added a log to ensure that it is the case and that no errors occurred during the script. If i run the test alone it works fine and without any errors. This occurs only if i run my whole execution plan. The next test also works fine. Not too sure what could be the cause of this error... 😕Solved3.8KViews1like8CommentsHow To Shorten the Length of a String Parameter
Hi, Everybody!... I wish to load test a SOAP web service. One of the parameters needs to be unique for each invocation. I am presently using${=java.util.UUID.randomUUID()}. Lamentably, I am getting the following error:String '<some UUID string>' is too long (length: 36, maximum allowed: 35). How can I shorten the length of the parameter? Please advise.Solved2.7KViews0likes13CommentsDragging of Jtable cell data on to other object
Hi, I am struggling a lot to use the coordinates with Drag method. The desktop application does not support copy/paste action on the object and we have to drag the data on it. I have attached an image. So, we have two objects in image, On top right, the object 1 jtable has few rows and we need to drag data from row 1...5 and col 1. (mean all cells in the first col). The height of each cell is 20 i.e each jtable cell is 20 + 20 + 20 and so on. Now the problem is I am unable to quite understand the parameters in the drag method. Four parameters are required, the first two seems to be working, but last two creating problems in combination with the first two parameters. I'm looking for a solution based on some equation using ScreenLeft and ScreenTop of both objects. Can anyone help by suggesting an equation by looking at the attached image please. This is something I need to proceed with my next scenarios. I'm using scripts and BDD scenarios. Thanks in advance.Solved2.5KViews0likes8CommentsAzure DevOps Integration - Re-running Failed Test
Hi Community, Did anyone manage to find a way how to re-run failed tests using AzureDevops? We currently are facing the problem that when a test fails inside a job (ex: a job has 5 tests, 4 passed but 1 failed), when rerunning failed jobs, all the 5 tests are re-executed. We would like to run only the specific test case which failed rather than the full job. Appreciate your feedback :)!2.4KViews0likes6Comments