ContributionsMost RecentMost LikesSolutionsReady API license Hi team, Need advise on this topic : Initally when we used SOAP UI 5.4.0 free version and when we integrated automated tests to run via jenkins ....we installed SOAP UI 5.4.0 on Jenkins server ... we pulled ready api automated tests from github onto jenkins server , create a automated batch file and call the batch file from jenkins job . we have recently upgraded SOAP UI Free version to ready api licensed version and ... we have been issued Individual licenses and has been installed locally to execute and create our ready api tests . However to make existing automated job to work and run our newly created tests using ready api version we need to upgrade SOAP UI 5.4.0 to ready API on Jenkins server but not sure how to handle licensing as license is tied to user not server . How do team handle this as licensing is tied to individual and not server based ? Do we need to create automated test user and issue license to him and run the automated tests under his portfolio from jenkins server ? Can we run the tests using existing licenses on jenkins server ? If so how ? Any pointers on how to move forward with this effort ? Re: How to delete a key value pair from JSON response, goovy script Thank you ! This works Re: How to delete a key value pair from JSON response, goovy script Thank you for direction .... I tried the groovy script and it works when JSON has single node but if JSON response sample has mulitple nodes and we need to remove ISEDIT from all nodes ..solution seems to be not working . can you provide sample for removing key in this case Here below is example of groovy script i tried with multiple nodes import groovy.json.JsonSlurper def Response = '''\ [{ "PVOptions" : "Yes, No", "UCount" : 449, "PName" : "Affordable Price All", "IsEdit" : true, "PCode" : "1234", "PPId" : 984, "IPNullable" : false }, { "PVOptions" : "Yes, No", "UCount" : 4495, "PName" : "Affordable Price All", "IsEdit" : true, "PCode" : "12345", "PPId" : 984, "IPNullable" : false }] ''' def slurperResponse = new JsonSlurper().parseText(Response) log.info("API Response results:" + slurperResponse.toString()) // slurperResponse is a Map, thus we call the remove method with the desired map entry key. slurperResponse.remove('IsEdit'); log.info("API Response results:" + slurperResponse.toString()) Result set returned : [[IPNullable:false, IsEdit:true, PCode:1234, PName:Affordable Price All, PPId:984, PVOptions:Yes, No, UCount:449], [IPNullable:false, IsEdit:true, PCode:12345, PName:Affordable Price All, PPId:984, PVOptions:Yes, No, UCount:4495]] How to delete a key value pair from JSON response, goovy script I have a groovy which basically make a rest request as below sample and returns JSON response. but in the response returned i would like to remove a key value pair(IsEditable = true) before i start comparing to DB values as we don't stoe that in DB. How do i find a key and remove the key before i start doing the DB compare step . Any sample code to look at on how we can remove the key ? // Use the json slurper class method to read the API response values def Response = context.expand( '${Validate Pparam #Response}' ) def slurperResponse = new JsonSlurper().parseText(Response) def sortedJSON = slurperResponse.data.sort { a,b -> b.PCode<=> a.PCode} log.info("API Response results:" + sortedJSON) Response returned : { "PVOptions" : "Yes, No", "UCount" : 449, "PName" : "Affordable Price All", "IsEdit" : true, "PCode" : "1234", "PPId" : 984, "IPNullable" : false } But i would like my response to be returning as below . How do i acheive this ? :("IsEdit" : true should not get returned) { "PVOptions" : "Yes, No", "UCount" : 449, "PName" : "Affordable Price All", "PmCode" : 347, "PCode" : "1234", "PParameterId" : 984, "IPNullable" : false } SolvedRe: No such property: ProjectFactoryRegistry for class: Script1 Any pointers? No such property: ProjectFactoryRegistry for class: Script1 Hello team, while trying to execute groovy scripts embedded in a test suite via Launch test runner i am getting this below error : I am able to execute groovy script in standalone mode with no issues . Any pointers why is failing with this error ? or provide solution if you had encountered similar issue Here below is ReadyAPI Testrunner log generated 10:17:08,991 ERROR [errorlog] groovy.lang.MissingPropertyException: No such property: ProjectFactoryRegistry for class: Script1 groovy.lang.MissingPropertyException: No such property: ProjectFactoryRegistry for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) at Script1.run(Script1.groovy:29) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98) at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:260) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:170) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:72) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:685) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.run(WsdlTestCasePro.java:104) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.run(WsdlTestCasePro.java:93) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:695) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runTestCase(SoapUIProTestCaseRunner.java:245) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:419) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:99) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:276) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:175) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:83) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:79) 10:17:08,997 ERROR [SoapUIProTestCaseRunner] Validate distinct Units in API response match DB failed, exporting to [C:\Program Files\SmartBear\ReadyAPI-2.3.0\bin\APITestSuite-APAPITests-Validate_distinct_Units_in_API_response_match_DB-0-FAIL.txt] Here below is sample groovy script: /* NOTES: Run this groovy test script */ import groovy.json.JsonSlurper import groovy.xml.XmlUtil import groovy.sql.Sql import groovy.sql.GroovyRowResult // Set Project level attributes def dbServer = context.expand( '${#Project#DatabaseServer}' ) def dbport = context.expand( '${#Project#port}' ) def dbInstance = context.expand( '${#Project#DatabaseInstance}' ) def dbname = context.expand( '${#Project#DatabaseName}' ) def projectworkspace = context.expand( '${#Project#ProjectWorkspace}' ) //Connection setup to database Instance sql = Sql.newInstance("jdbc:sqlserver://$dbServer:$dbport;instanceName=$dbInstance;databaseName=$dbname;integratedSecurity=true") //Exesute NewPricingAPI call using testrunner variable def workspace = testRunner.testCase.testSuite.project.workspace def prj = (workspace==null) ? ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew("$projectworkspace") : workspace.getProjectByName("NPAPI") if(!prj.open && workspace!=null) workspace.openProject(testProject) tCase = prj.testSuites['NPAPI-TestSuite'].testCases['NPAPI'] tStep = tCase.getTestStepByName("Validate NPAPI") def runner = tStep.run(testRunner, context) log.info ("runner status ....... : " + runner.hasResponse()) // Using Json Slurper class method to read NPAPI response values def Response = context.expand( '${Validate NPAPI#Response}' )//creating instance of slurperclass def slurperResponse = new JsonSlurper().parseText(Response) def sortedJSON = slurperResponse.data.units.sort {it.unit_id} log.info(sortedJSON) //Get PD date API returned log.info(" Print PDate APAPI returned data for " + PDate) def count = sortedJSON.size() log.info('API count of Unit : ' + count) // SQL Query to Pull Database values def result = sql.firstRow(""" select distinct(unitid) from table """) dbproperty = result.toString() log.info('Count of units in Database :' + dbproperty) //Compare API reponse string to DB string value if (count.toString() == dbproperty.toString()) log.info ("Count of Units API match DB") else log.info ("Count of Units API do not match DB") project factory registry Hello team, I am getting this error while trying to execute groovy script via Launch Test Runner . when I try to run the groovy script in standalone mode i don't encounter this issue . can any one help me point out issue and provide any solution if you had encountered the same Here below is the ReadyAPI Test Runner log message: 10:17:09,010 INFO [SoapUIProTestCaseRunner] TestCase [APAPITests] finished with status [FAIL] in 1831ms groovy.lang.MissingPropertyException: No such property: ProjectFactoryRegistry for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) at Script1.run(Script1.groovy:29) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98) at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:260) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:170) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:72) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:685) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.run(WsdlTestCasePro.java:104) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.run(WsdlTestCasePro.java:93) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:695) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runTestCase(SoapUIProTestCaseRunner.java:245) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:419) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:99) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:276) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:175) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:83) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:79) Here below is sample groovy script /* NOTES: Run this groovy test script to validate Clients match DB results */ import groovy.json.JsonSlurper import groovy.xml.XmlUtil import groovy.sql.Sql import groovy.sql.GroovyRowResult // Set Project level attributes def dbServer = context.expand( '${#Project#DatabaseServer}' ) def dbport = context.expand( '${#Project#port}' ) def dbInstance = context.expand( '${#Project#DatabaseInstance}' ) def dbname = context.expand( '${#Project#DatabaseName}' ) def projectworkspace = context.expand( '${#Project#ProjectWorkspace}' ) //Connection setup to database Instance //sql = Sql.newInstance("jdbc:sqlserver://$dbServer:$dbport;instanceName=$dbInstance;databaseName=$dbname;username=$dbusername;password=$dbpassword") //Exesute NewPricingAPI call using testrunner variable def workspace = testRunner.testCase.testSuite.project.workspace def prj = (workspace==null) ? ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew("$projectworkspace") : workspace.getProjectByName("APAPI") if(!prj.open && workspace!=null) workspace.openProject(testProject) tCase = prj.testSuites['APAPI-TestSuite'].testCases['APAPITests'] tStep = tCase.getTestStepByName("Validate APAPI") def runner = tStep.run(testRunner, context) log.info ("runner status ....... : " + runner.hasResponse()) // Using Json Slurper class method to read APAPI response values def Response = context.expand( '${Validate APAPI#Response}' )//creating instance of slurperclass def slurperResponse = new JsonSlurper().parseText(Response) def sortedJSON = slurperResponse.data.units.sort {it.unit_id} log.info(sortedJSON) //Get the count of Unit in API response to validate against db count log.info(" Print APAPI returned data for " + PDate) def count = sortedJSON.size() log.info('API count of Unit_ID : ' + count) // SQL Query to Pull Database values def result = sql.firstRow(""" select * from AP """) dbproperty = result.toString() log.info('Count of unitID in Database :' + dbproperty) //Compare API reponse string to DB string value if (count.toString() == dbproperty.toString()) log.info ("Count match DB") else log.info ("Count do not match DB") Re: how to pass Valid and Invalid value to resource endpoint parameter Thank you for your time and help clarify issue . Re: how to pass Valid and Invalid value to resource endpoint parameter Thank you for sharing structure and i gave this approach a try! .... but looks like i am not able to change the resource URL in the rest test step level .How did you change the resource URL in these below test steps as i am unable to edit that section ? For Valid Project ID i see the resource URL is : ${#Project#somevalidproject ID}/newpricing/ and for invalid Project ID is see the resource URL says : : ${#Project#Invalidproject ID}/newpricing Rest method invoke for request when the test step created looks like this :https://endpointURL/${#Project#project ID}/newpricing/ Re: how to pass Valid and Invalid value to resource endpoint parameter Any suggestions. I am using soapUI free version so wondering if there is another way to accomplish this where we can pass valid and invalid data at test case level to the same resource end point