ContributionsMost RecentMost LikesSolutionsRe: How to reuse a groovy teststep inside the project assertion scripts I didn't find the problem during step-by-step debugging. It started working (have no explanation): import com.eviware.soapui.support.types.StringToObjectMap import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner def runner = new WsdlTestCaseRunner(messageExchange.modelItem.testStep.testCase, new StringToObjectMap()); def mySteps = messageExchange.modelItem.testStep.testCase.testSuite.project.testSuites["Helpers"].testCases["Objects"].testSteps["Cookie"]; mySteps.run(runner,context); log.info context.Cookie.info() def cookies = context.Cookie; log.info cookies.info() log.info context.getProperty("Cookie").info() How to reuse a groovy teststep inside the project assertion scripts I have a working groovy test script (a helper Cookie class with instance creation inside the script): context.setProperty("Cookie", new Cookie(log, context, testRunner)) and re-using the Cookie: project = testRunner.testCase.testSuite.project; testStep = project.testSuites["Helpers"].testCases["Objects"].testSteps["Cookie"]; testStep.run(testRunner, context); log.info context.Cookie.info() Runs fine from other groovy scripts in the project. But I need to re-use the code in the assertion scripts as well. Tried import com.eviware.soapui.support.types.StringToObjectMap import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner //def Runner = new WsdlTestCaseRunner(messageExchange.modelItem.testStep.testCase, new StringToObjectMap()); def Runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner( messageExchange.modelItem.testStep.testCase, new com.eviware.soapui.support.types.StringToObjectMap()); def mySteps= messageExchange.modelItem.testStep.testCase.testSuite.project.testSuites["Helpers"].testCases["Objects"].testSteps["Cookie"]; mySteps.run(Runner,context); log.info mySteps.name log.info context.Cookie.info() but got name is ok; Runner is a valid instance. But Cookie is null. Error in assertion script of the [Login - Unregistered Mobile User Login] test step: Cannot invoke method info() on null object Can anyone help me solve the problem, please... Script library works fine but is not an appropriate case as it requires additional permissions to write to the destination folder - a jenkins job on a cluster... SolvedData Source Grid - missing a row while selecting all rows (0) Hi! I have JSON list of objects. Tried to configure JSON data source. Failed. I don't want to have additional external files (csv, xls...). During configuring and testing Grid data source I've faced with a problem. The first row doesn't display after run data source. How to fix it? ReadyAPI v3.9.0 It looks like a bug, because next time I've ran Source Data I got weird generated data - values don't fit their keys (shuffled data)... SolvedRe: Unexpected template element in a request The issue appears each time when a copied resource from Postman pasted into a readyAPI APIs definition field : /gmail/v1/users/{{email}}/threads{{q}} Once pasted (and doesn't matter it is corrected or not in readyAPI) it will appear in the request each time you start readyAPI. The problem is double curved brackets. How to fix this without a resource deletion in order to not lose the dependent test steps? Unexpected template element in a request Hi there, I've noticed strange behavior of readyAPI (3.9.0 (license) at Big Sur 11.5.2 (20G95)). I haven't entered a highlighted template entry. It occurred after a new day start the readyAPI. A deleted highlighted entry in API request updates dependent test step. Saving all project. Restarting readyAPI. All is Okay. But the next day after starting the readyAPI I have the entry again. It looks like some sort of backup specifically cancels saved changes for this issue. .. The API has been imported from a Postman collection. How to avoid the issue? An attempt to set a property value of Integer data type throws an error I'm trying to set an integer value for a property (groovy script in a test case and on a setup tab of the test case): def count = 0 testRunner.testCase.setPropertyValue( "loops", count ); and getting an error message: groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestCasePro.setPropertyValue() is applicable for argument types: (String, Integer) values: [loops, 0] Possible solutions: setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String) error at line: 2 It looks like an Integers and Float are not supported. Where I'm wrong? The code below runs successfully. def password = org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(10) testRunner.testCase.setPropertyValue( "upsPassword", password ); SolvedreadyAPI feature - automatic passing cookies to following request with “Maintain HTTP Session” I'm on ReadyAPI 3.9.0 (trial). Have seen documentation and tried to use “Maintain HTTP Session” https://www.soapui.org/docs/soapui-projects/form-based-authentication/#_ga=2.117081990.1241344506.1627629137-2061271821.1627629137 and other questions on the https://community.smartbear.com/t5/SoapUI-Open-Source/ I use Add a Header with a key name Cookie to a Request and set the Value to ${REST login#HarResponse#$['headers'][5]['value']} to get auth cookies in the request headers. But the order of the Headers in the HarResponse json is not constant and [5] in my case is a variable list element index that is not comfortable during automated tests. Groovy scripting is ok but again to repeat a script for each step is inconvenient and boring in comparison with Postman or a web browser style of normal (automatic) Set-Cookie. More over the manual adding a Cookie section to the request headers doesn’t allow the testers (for which readyAPI has been developed) to test a “Set cookies” workflow that is not good for the specialized software that is readyAPI. It looks like many things for start working with or migrating to readyAPI were not in a focus in the documentation... Could you show me the easiest way to automate Set-Cookie as a result of a server response or tell me where I’m wrong with “Maintain HTTP Session” option? Hope the issue is not the case of a trial version. SolvedRe: readyAPI feature - automatic passing cookies to following request with “Maintain HTTP Session” Update. To those who are switching from Postman. A readyAPI feature. Automation with “Maintain HTTP Session” works fine ONLY when one runs test steps as a Test Case and doesn't work when running test steps one-by-one (for example if you try debugging a test step like in Postman). For the debug purpose in “Maintain HTTP Session” mode there are a "bug" button (next to a run button under the TestCase name) and a "Step-by-Step Run" tab. There is lack of warnings for the feature in the docs. A lot of time has been wasted to get it worked. Re: readyAPI feature - automatic passing cookies to following request with “Maintain HTTP Session” Thanks for the link nmrao. I've already googled this solution and that is exactly I have mentioned in my root post (about Groovy script). nmrao wrote: Please see if the below link helps https://github.com/nmrao/soapUIGroovyScripts/blob/804652073a8e7c1259bc567c7bf3d2a71e2f4254/groovy/scriptAssertions/cookies/AddCookiesToNextRequest.groovy But the question is simple how to debug or write a Test Case with “Maintain HTTP Session” having a bunch of test steps in a serie??? May be the answer is too simple...