Caused by: groovy.lang.MissingPropertyException: No such property: testCase for class: Script2
I'm using below script to get the error message from test-step in listener level. I place this script under TestRunListener.afterRun def logPrefix = testCase.getName() + ': ' log.info (logPrefix + 'Number of results = ' + testRunner.getResults().size().toString()) for(result in testRunner.getResults()){ if(result.getStatus().toString() != 'PASS' ){ def failedTestStepName = result.getTestStep().getName() def logPrefixStep = logPrefix.trim() + failedTestStepName + ': ' log.error(logPrefixStep + 'TestStep "' + failedTestStepName + '" finished with the status ' + result.getStatus().toString()) for(testProperty in testCase.getTestStepByName(failedTestStepName).getPropertyList()){ if(testProperty.isReadOnly()){ log.info(logPrefixStep + 'Output property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) }else{ log.info(logPrefixStep + 'Input property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) } } for(message in result.getMessages()){ log.error(logPrefixStep + 'Error message: ' + message) } } } whenever running my test cases. I'm getting below error Thu Nov 21 15:32:05 UTC 2019: ERROR: com.eviware.soapui.support.scripting.ScriptException: Error in TestRunListener.afterRun com.eviware.soapui.support.scripting.ScriptException: Error in TestRunListener.afterRun at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(DefaultSoapUIEventHandler.java:31) at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(AbstractEventHandlerMetaData.java:80) at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(AbstractEventHandlerMetaData.java:61) at com.eviware.soapui.eventhandlers.impl.EventHandlersTestRunListener.afterRun(EventHandlersTestRunListener.java:36) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.notifyAfterRun(AbstractTestCaseRunner.java:360) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:212) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:1) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:154) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: groovy.lang.MissingPropertyException: No such property: testCase for class: Script2 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:66) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:310) at Script2.run(Script2.groovy:4) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:94) at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:83) at com.eviware.soapui.eventhandlers.support.DefaultSoapUIScript.invoke(DefaultSoapUIScript.java:42) at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(DefaultSoapUIEventHandler.java:29) ... 12 more I'm using readyAPI 3.0.Solved27KViews0likes2CommentsCan I put multiple project in one Git repository?
Dear Community, I'm setting up Gitlab repository to allow multiple tester to work together on scripts for the different modules we develop. I initially thought to create one repository named "API-Script" and put all the ReadyAPI project in it (one ReadyAPI project per module we develop). Is somebody could tell me if it's possible? And if it's not a good practice, why? Thanks,Solved24KViews0likes7Commentsgetting BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy'
Hi All. I'm working on the script library in readyAPI 2.8.0 I have a readyAPI project saved in C/soapui and I've created a folder calledGroovyLibrary inside the project folder (C/soapui/GroovyLibrary). I place my below script inside the groovyLibrary folder. package soapui .GroovyLibrary class Callee { String hello() { return "Hello world!" } def static salute( who, log ) { log.info "Hello again $who!" }} I followed the exact the way it mentioned in the below documentation https://support.smartbear.com/readyapi/docs/testing/scripts/library.html#_ga=2.210636115.718279044.1573586134-774997694.1532459669 but while executing the groovy from readyAPI; I'm getting below execption BUG! exception in phase 'semantic analysis' in source unit 'Script2.groovy' The lookup for Callee caused a failed compilaton. There should not have been any compilation from this call. How can I rectify this? anyhelp would be appreciated. Thanks.Solved15KViews0likes9Commentsgetting groovy error when trying to run groovy script - EvictableCache
Any ideas how to fix this? ERROR: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.memoize.EvictableCache.getAndPut(Ljava/lang/Object;Lorg/codehaus/groovy/runtime/memoize/MemoizeCache$ValueProvider;)Ljava/lang/Object;Solved13KViews0likes11CommentsSOH and STX charcters are being replaced with quetion mark(?) in the soapui XML file.
We have been trying to create a project in soapui to invoke a rest api service. The rest API service POST method accept text with special charcters(SOH and STX) as request. When we are trying to save the project with .xml file,SOH and STX charcters are beingreplaced with question mark(?) in xml file. Below configuration is used in soapui tool. Service : REST API Method: POST Content-type: text/plain Charset : utf-88.9KViews0likes15Commentsorg.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:
Hi All, I'm trying to connect selenium from readyapi, I followed the same steps given in the selenium integration documentation, but I'm getting below error org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:38669 Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48' System info: host: 'ITORL464', ip: '192.168.102.6', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: FirefoxDriver error at line: 7 I'm new to this, anyhelp is appreticated. I'm using geckodriver-v0.9.0 selenium-java-3.14.Solved8.9KViews0likes1CommentInvalid xml as special character in request body
Hi Community, I encountered a special character issue with my REST POST payload (request body). As request, the payload include other characters, like Simplified (测试) / Traditional(測試) Chinese. after save project, the test case will be missing due to invalid xml. I open it with XML Spy and said there are invalid characters (acutally it's mass code becoz of special characters). If I accept XML spy convertion, then this xml would be imported into ReadyAPI. I search the same issue from forum, but seems did not find a solution. Checked the encoding, it's UTF-8 in header of xml. Content-type of my payload is application/json, appreciated if anyone who would provide available solution for that. Thanks, /AaronSolved8.5KViews0likes7CommentsHow to get request body using a groovy script in ReadyAPI
Hi, The request (getDrafts) I'm testing takes a list of periods and reply with a list of data for those periods. Request body: { "periods" : ["202101","202102"] } Response body: { "drafts" : [ { "period" : "202101", "data" : { "name" : "Kalle Kula", "epost" : "kalle@kula.se" } }, { "period" : "202102", "data" : { "name" : "Krille Krokodil", "phone" : "9876543210" } } ] } I would like to create a script that reads the requested periods from the request body, and for each value verifies that there is an item for that period in the response body. I also want to verify the content of the data-part for each item but first things first🙂 The problem is I cannot figure out how to get the contents of the request body from my groovy script. Kind regards, CamillaRSolved8.4KViews0likes6Comments