ContributionsMost RecentMost LikesSolutionsRe: Is there a way to add a line in Transaction Log tab when using run() ? Unfortunately, no. I don't know if an update has been done since my request. Incease the script editor Hi ! It would be nice to increase your script editor. Just have a better undo or be able to save our script in a file and reload it would be a great plus value. It is too easy to lose our script when we are working from a window to another. Re: Is there a way to add a line in Transaction Log tab when using run() ? Yes, but I want a trace in the Transaction log tab, not in the Script log. When I generate a report, I see the transaction logs, not the script logs in the report. Is there a way to add a line in Transaction Log tab when using run() ? Hi, In my Groovy scripts, I like to rename my Test Step so I can verify quickly what have failed directly by looking the Test Step name in the Transaction Log tab when I execute my Test Case. However, when I call other test steps via my Groovy script and use the run() command instead of gotoStep() I don't have a line in my Transaction Log tab. Is there a way to add a line in Transaction Log tab when using run() ? Currently with run() I do : testStep = testRunner.testCase.getTestStepAt(2) testStep.setName("Script validation for ID :" + context.ID_FORM) testStep.run(testRunner,context) Re: Problem with a gotoStep in sql.eachrow So, as explained, I changed gotoStep by run(). In my eachrow loop, I do : sql.eachRow(sqlRequete) { row -> //If the keyset is null create one and add the column names if (keyset == null) { //We want all the column names exept the one named 'id keyset = row.toRowResult().keySet().findAll{ it } } keyset.each() { k -> context.setProperty("$k",row."""$k""") } testStep = testRunner.testCase.getTestStepAt(2) testStep.setName("Script - BD - Liste des enseignants classe virtuelle [idSite:" + context.SEQ_SITE_COURS + "][CV:" + context.SEQ_CLASSE_VIRTUELLE + "]") testStep.run(testRunner,context) } And then I'm able to execute my script logic explained in my previous post. Thanks ! Re: Problem with a gotoStep in sql.eachrow If I try to summarize my script. Step 1 : Script with a sql.eachrow and in this loop I want to call Step 2, (then Step 3) and do the same with the next row. Once the loop is finished, I call Step 4 (which looks like log.info('Test finished') as you described). Step 2 : Execute the script then go to Step 3. Step 3 : Execute the script then go back to Step 1. Step 4 : The step is reached only when the loop in Step 1 is finished. ------------------------------------ The only thing I'm not sure to understand in your explanation is : Can I call a step with gotoStep() in a eachRow() loop ? I must prefer run() ? Can you give me an example of calling a test step with run() ? I'm not familiar with this command. Thanks a lot, Problem with a gotoStep in sql.eachrow I have a Groovy script with a SQL request and I want to execute some test steps for each row. I put some log.info in each of my scripts to have a follow up. In my code just below, even if I see my log.info line in the script log and the step name change very quickly, it doesn't seem to go to step 2 because I don't see the log.info line of my step 2 which is at the very first line of my Groovy script.. I would like for each of my sql rows to execute step 2 and 3 and then, when finished, go to step 4. My code at step 1 : import groovy.sql.Sql com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.OracleDriver") // scripts = testRunner.testCase.testSuite.project.testSuites["Script Library"]; scripts.testCases["BaseDonnees"].testSteps["Connexion"].run(testRunner, context); def sql = Sql.newInstance(context.connexion.path,context.connexion.username,context.connexion.password,context.connexion.driver) //def rownum = context.expand( '${#TestCase#totalTests}' ) def sqlRequete = '''SELECT BLABLABLA''' def keyset = null; //A place to keep the column names sql.eachRow(sqlRequete) { row -> //If the keyset is null create one and add the column names if (keyset == null) { //We want all the column names exept the one named 'id keyset = row.toRowResult().keySet().findAll{ it } } keyset.each() { k -> context.setProperty("$k",row."""$k""") } log.info(context.SEQ_CLASSE_VIRTUELLE + '-' + context.SEQ_SITE_COURS) testRunner.testCase.getTestStepAt(2).setName("Script - BD - Liste des enseignants classe virtuelle [idSite:" + context.SEQ_SITE_COURS + "][CV:" + context.SEQ_CLASSE_VIRTUELLE + "]") testRunner.gotoStep(2) } testRunner.gotoStep(4) //Fin du test automatisé - tout ce qu'il y avait dans la requête BD a été analysé My code at step 2 : import groovy.sql.Sql com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.OracleDriver") log.info('ETAPE2') // scripts = testRunner.testCase.testSuite.project.testSuites["Script Library"]; scripts.testCases["BaseDonnees"].testSteps["Connexion"].run(testRunner, context); def sql02 = Sql.newInstance(context.connexion.path,context.connexion.username,context.connexion.password,context.connexion.driver) //def rownum = context.expand( '${#TestCase#totalTests}' ) def sqlRequete02 = '''SELECT SECOND BLABLABLA''' log.info('REQUETE SQL 2 = ' + sqlRequete02) def keyset = null; //A place to keep the column names sql02.eachRow(sqlRequete02) { row -> //If the keyset is null create one and add the column names if (keyset == null) { //We want all the column names exept the one named 'id keyset = row.toRowResult().keySet().findAll{ it } } keyset.each() { k -> context.setProperty("$k",row."""$k""") } testRunner.gotoStep(3) //Validation - Contenu réponse service } testRunner.gotoStep(1) //LOOP - Liste des classes virtuelles Solvedis there a way to call a testsuite from another project Hi, I have developed a Test Suite which is in fact a script library. The way I found to call it in my Groovy script is, for example : scripts = testRunner.testCase.testSuite.project.testSuites["Script Library"]; scripts.testCases["DataBase"].testSteps["Connect"].run(testRunner, context); def sql = Sql.newInstance(context.connexion.path,context.connexion.username,context.connexion.password,context.connexion.driver) How should I declare scripts if I want to call my library from another project ? Re: Is there a way to call a context property with hashtag ? Got it, thanks ! I will definitively use the shorter version :) Re: Is there a way to call a context property with hashtag ? It works with log.info context.expand('${idEna}') Thank you !