ContributionsMost RecentMost LikesSolutionsRe: Get total DataSource rows incorrect Hi, Thanks for your reply. It does indeed work when I run the script seperately from running the whole testcase. But I would like to run it as part of a testcase with datasource loop. I have the following sript: def dsRowCount = testRunner.testCase.testSteps["DataSource"].rowCount int dsRowCountAsInt = dsRowCount as Integer def currentRowCount = testRunner.testCase.getTestStepByName("TestData").getPropertyValue("currentRowDataSource") int currentRowCountAsInt = currentRowCount as Integer log.info "Current row is: " + currentRowCountAsInt log.info "Total number of rows is: " + dsRowCount if(currentRowCountAsInt < dsRowCountAsInt){ //Add 1 to current row count currentRowCountAsInt = currentRowCountAsInt + 1 currentRowCountAsString = Integer.toString(currentRowCountAsInt) log.info "new currentRowCountAsString count = " + currentRowCountAsString //Set this new count as currentRowCount testRunner.testCase.getTestStepByName("TestData").setPropertyValue("currentRowDataSource",currentRowCountAsString) assert statusApplicationAsInt == 900 : "Test passed: status 900 reached. Application of 'banksparen' succeeded for row " + currentRowCountAsInt + "." } This is the result: Fri Nov 08 10:03:40 CET 2019: INFO: Current row is: 1 Fri Nov 08 10:03:40 CET 2019: INFO: Total number of rows is: 1 Fri Nov 08 10:03:40 CET 2019: INFO: 'isQcautoRunBefore' is set back to 'false' after a complete succesful run I expect Total number of rows is: 4 because there are 4 rows in the Excel file. The following is what happens when running the script seperately (after preloading the Excel datasource): Fri Nov 08 10:15:04 CET 2019: INFO: Current row is: 1 Fri Nov 08 10:15:04 CET 2019: INFO: Total number of rows is: 4 Fri Nov 08 10:15:04 CET 2019: INFO: new currentRowCountAsString count = 2 Get total DataSource rows incorrect I used the following short command to get the total number of rows from the DataSource after reading this community question (https://community.smartbear.com/t5/SoapUI-Pro/how-to-count-the-number-of-rows-fetched-in-data-source/m-p/178520/highlight/true#M40637): DSrowCount = testRunner.testCase.testSteps["DataSource"].rowCount log.info DSrowCount But this doesn't seem to work, because it returns 1 when there are actually 4 rows. It seems to count only the current row in the DataSource loop. Is there a way to always get the exact number of rows from my Excel file? Am I doing something wrong? Maybenmraoortech321? SolvedRe: SoapUI Jenkins: how to use TestSuiteRunListener The following code worked for me with the help of Smartbear and this Smartbear community topic: import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner import com.eviware.soapui.support.types.StringToObjectMap import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext def testcase = testRunner.getTestSuite().getProject().getTestSuiteByName("testsuite").getTestCaseByName("testcase") if(testcase != null) { WsdlTestCaseRunner wtcr = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testcase, new com.eviware.soapui.support.types.StringToObjectMap()) testcase.getTestStepByName("teststep").run(wtcr ,wtcr.createContext(null)) } SoapUI Jenkins: how to use TestSuiteRunListener Hi, I have a test pipeline running in Jenkins with a SoapUI node connected to it. I want to run a script (in a test suite, in a testcase) ONE time before I start running my testsuite (I have only one for now). I thought about using the Event TestRunListener.beforeRun, but that will run the script everytime a test case starts.Then I thought about using the TestSuiteRunListener.beforeRun. But that one gave the following exception: 08:59:45 08:59:45,811 ERROR [EventHandlersRequestFilter] com.eviware.soapui.support.scripting.ScriptException: Error in TestSuiteRunListener.beforeRun 08:59:45 08:59:45,817 ERROR [SoapUI] An error occurred [Error in TestSuiteRunListener.beforeRun], see error log for details 08:59:45 08:59:45,818 ERROR [errorlog] com.eviware.soapui.support.scripting.ScriptException: Error in TestSuiteRunListener.beforeRun 08:59:45 com.eviware.soapui.support.scripting.ScriptException: Error in TestSuiteRunListener.beforeRun 08:59:45 Caused by: groovy.lang.MissingPropertyException: No such property: testCase for class: com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner Apparently there is something wrong with the following code that I use: // Check if the test case is run from the command line if (com.eviware.soapui.SoapUI.isCommandLine()) { log.info "This code is executed by Command Line SoapUI" log.info "Now running setup scripts" def testCase = testRunner.testCase.testSuite.project.testSuites['testsuite'].testCases['testcase'] def testStep = testCase.getTestStepByName("teststep") testStep.run( testRunner, context ) } It doesn't recognize testCase for class: com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner used here: def testCase = testRunner.testCase.testSuite.project.testSuites['testsuite'].testCases['testcase'] So how do I script to have the testRunner run the testcase'Setup Project' in the testsuite 'tooling-general' using theestSuiteRunListener.beforeRun? SolvedComposite project warning file has not been loaded While running a SoapUI test in Jenkins I get the following warning: 16:52:51 16:52:51,093 WARN [CompositeProjects] The file has not been loaded, because it is not specified in the project: /home/able/jenkins/workspace/REGRESSION_QCAUTO_0716/europort_test_automation/tooling-general/KeepAlive.xml The file does not exist. It did exist before in Git, but it was removed and is not in Git anymore. How do I get rid of this warning? SolvedRe: Jenkins - Failed to load the project file: Could not start SoapUI Pro functional testing HiTanyaYatskovska, I only know the settings.xml in my project directory, so i ran this command line with command prompt: testrunner.bat -FPDF "-RJUnit-Style HTML Report" "-cmy TestCase" "C:\software-vm3\ep-test-automation\settings.xml". This also leads to '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file. '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file. '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file. C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin> Re: Error occurs when running DataSource Hi bktientu, Thanks. I had tried the first option of course, but it still said it couldnt find the file. The second option worked. Unfortunately, I dont know what the problem was with the other options, but it works now Re: Jenkins - Failed to load the project file: Could not start SoapUI Pro functional testing Hi I tried to do this, but I don't know where to get the project xml; this is a composite project, so I don't know what to put at"c:\my projects\my-project.xml" Error occurs when running DataSource When I try to run a DataSource I receive the following error: An error occured:C:\..\ep-test-automation\resources\test_data\banksparen-chain\qanda.banksparen-chain.xlsx (The system cannot find the path specified). In the project settings I have the following settings: File - C:\software-vm-3\ep-test-automation Resource root -${projectDir}/ep_test_automation/resources When I run this in a Groovy script: def projectPath = testRunner.testCase.testSuite.project.getPath() log.info projectPath the project path is this:C:\software-vm3\ep-test-automation. The actual file is located here:C:\software-vm3\ep-test-automation\resources\test_data\banksparen-chain\qanda.banksparen-chain.xlsx Does anybody have a suggestion? SolvedRe: Jenkins - Failed to load the project file: Could not start SoapUI Pro functional testing When I do a simple launch testrunner (via readyapi, all test cases/ all test suites), it says: Running ReadyAPI TestRunner for [europort_test_automation] directory: C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin command: cmd.exe /C testrunner.bat -r -a -j -f${WORKSPACE} "-RJUnit-Style HTML Report" -FXML "-EDefault environment" C:\software-vm3\europort_test_automation '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file. '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file. '"C:\Program Files\SmartBear\ReadyAPI-2.7.0\bin\..\jre\bin\java"' is not recognized as an internal or external command, operable program or batch file.