ContributionsMost RecentMost LikesSolutionsRe: Building awesome frameworks in SoapUI ! Hello Prasad, I didnt hear from you. Nonetheless I am working on putting all my knowledge and experience into a general purpose book on how to build frameworks in SoapUI. Hopefully in few weeks or months, I could share more with you. In between, if you have any generic question, do not hesitate to ask. Cheers, Pramod Re: Building awesome frameworks in SoapUI ! Hello Prasad, I would not be able to share my project framework since it contains client information, however in future I do intend to create some code snippets to share the general keywords for others use. For now, what I can do is, help you with any specific problems you are facing at this moment. I can share code snippets or suggestions that you may be able to customise for your project. Do let me know if that helps? Regards, Pramod Re: How to get a steps index number using groovy? Perfect. Works great! Thank you for sharing. How to get a steps index number using groovy? While saving my log results for each script, I wanted to start them with the steps index number. When I add context.currentStepIndex in a groovy step and run it from that step, I get the correct step index (say 20). However I have a data driven groovy script (say step 5), from where all other scripts are called. When all steps are called from within this step 5, the index that comes out for all steps is 5 and not 1,2,3... 20 etc. I understand why it may do so, but can anyone suggest a workaround to get the index numbers for each script keepin the same framework model? P.S: I could use a counter to set the property at testSuite level and read this in making log files but was hoping to find a cleaner approach than that. SolvedRe: Changing log output line text color Looks awesome. Can you give an example on how to use this? I tried running the code but get multiple compilation errors. Re: How to set testCase endpoints using Groovy Scripts? SmartBear_SuppoWonder why no one gave Kudos to this reply yet. Here it goes :). Kudos ! As an additional note. if you want to use the endpoint url from a parameter defined at say TestSuite level, just change the TestCase to TestSuite in the endpoint url space. Something like this: ${#TestSuite#sGetTxsEndPointUrl} Where, GetTxsEndPointUrl is a custom property i created at TestSuite level. If all your requests now have this formula at end point Url, there is no need to set, reset urls at test step level. Hope this helps to others. Cheers, Pramod Get Set and Reset Test case properties from Groovy script Problem statement: If you are looking for a way to run individual groovy scripts (not full test case) while getting the context variable values set in another script, below may help you. Note that the solution was already available on forums but parts of solution were scattered in multiple posts. Here I simply consolidate them in one place. Credits are at the end of this post. Groovy scripts: //Step1: For this example, Create two properties named zOSUserID and zOSPwd on the test case under which you are going to create below groovy script. //Step2: Set TestCase parameters value (you can have this in one groovy script on two, depending on what your use case is) context.testCase.properties["zOSUserID"].value = "fromGroovy" context.testCase.properties["zOSPwd"].value = "dummy" //Step3: Get TestCase properties value (again, you may have set the values in one script and may be using it in same or different scripts (mostly this case) def userID = testRunner.testCase.properties["zOSUserID"].value //To get Testsuite property, replace testCase with testCase.testSuite log.info "userID : $userID" def password = testRunner.testCase.properties["zOSPwd"].value log.info "password : $password" //Step4: Reset each test case property value (This script, although can be in same script, but will usually be the last groovy script in test case, after which you want to start a new iteration context.testCase.properties.each { context.testCase.properties[it.key].value = '' } //( above was used for test case. For test suite replace context.testCase with context.testCase.testSuite in the code snippet.) //To avoid getting script message log.info "end" Note: You can now run this groovy script and see how the properties are changed at test case level. Comment uncomment the reset part of above code to see how it affects test case parameters. Note that this work for simple variables but not for arrays. If it could work for arrays, that would have been really powerful (for debugging individual scripts at least). For now, even this, can help you where you don't need to pass arrays between scripts. Hope it helps. Credits and references: @nmaro : https://community.smartbear.com/t5/SoapUI-Pro/How-to-i-clear-the-property-values-of-a-TestCase-or-TestSuite/m-p/113726#M26452 krogold: https://community.smartbear.com/t5/SoapUI-Open-Source/How-to-write-a-property-value-in-testSuite-s-setup-script/m-p/152563# omatzura: https://community.smartbear.com/t5/SoapUI-Open-Source/global-variables-between-suite-and-test-case/td-p/2099 Re: Script containing logMonitor.getLogArea( "script log" ) fails when SoapUI is run from Jenkins or Cmd No apologies, I understand you are only trying to help.I am indeed using testrunner.bat in jenkins in its command line option . And irrespective of if I use it from jenkins or directly from windows command line, the results are same. So may be you are right thatthis method is only available from UI. Is there a place you are aware where I can find a list of objects that are only available from UI (Or not available from command line?). TanyaYatskovska:Or if SoapUI creators are listening, making this possible with command line? Thanks once again for all your help, support and time. I do appreciate it a lot. Keep up the good work :). Re: Script containing logMonitor.getLogArea( "script log" ) fails when SoapUI is run from Jenkins or Cmd I am using assertionsvery extensively in each script. Neither am I using logs to make decisions. I also agree with you that if a failure happens, the retest has to happen for full data set. But that's not why I (or my team) is entirely using the logs. We areusing logs for two purposes. As test results and to look back and understand what all paths are taken in previous scripts (if there is a failure). There are too many parameters that we have to consider during debugging. So we use individual scripts status, overall test status, assertions, logs all (and each serve a particular purpose). The problem now is when I want to schedule health checks, all test steps where we are using logarea are failing. Is there is a solution (or workaround) that we can use? Thanking you once again for your time and support. Re: Script containing logMonitor.getLogArea( "script log" ) fails when SoapUI is run from Jenkins or Cmd Hellonmrao, Thanks for your reply. I am using the script and test status also and it works perfectly well to show what failed. But since we have a framework where the inputs from one script decide what flow will be taken in other scripts, often its the log.infos from scripts that helps us debug and troubleshoot. Also these log.infos act as test proofs of all the things we have tested (in case if we have issues in production and want to narrow down the root cause of issue). Hence the requirement. Are you aware of anything that I can use here to get these log.infos (we are writing them into text files and thats where the scripts ar failing when run from jenkins). Thanks again for taking out your time to help others. I appreciate it :).