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,Solved24KViews0likes7Comments[SoapUI 5.2.1] mockRequest is NULL in REST MockService
I'm using SoapUI 5.2.1 and I have a REST MockService. Whenever I try to implement the following script, I get the NullPointerException . Script: def requestBody = mockRequest.getRequestContent() log.info "Request body: " + requestBody Error: com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException: Cannot invoke method getRequestContent() on null object This is a very frustating error that I'm continuously getting, and surprisingly there is no helpful solution anywhere. Please Help!!!! PS : I'm trying to get the content of a HTTP GET request.Solved22KViews0likes14CommentsReadyAPI - "Remote host terminated the handshake" on server with SNI enabled
Hello everybody, We are setting up a test suite using ReadyAPI 3.3.0. It's making HTTPS Rest calls, using NTLM authentication which I set up and seems to succeed. The issue I'm running into is that every other call fails due to the following error: Error getting response; javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake. I've dug into a lot of solutions at this point, and I'm running out of ideas. I tried editing the ReadyAPI vmoptions in the bin folder to add: -Dsoapui.https.protocols=SSLv3,TLSv1.2 -Dsoapui.https.ciphers=TLS_RSA_WITH_AES_256_CBC_SHA256 I've tried adding the following to the ready-api.bat file: set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.https.protocols="TLSv1.2" set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.debug=all set JAVA_OPTS=%JAVA_OPTS% -Djdk.tls.client.protocols="TLSv1.2" set JAVA_OPTS=%JAVA_OPTS% -Dhttps.protocols="TLSv1.2" But none of these solutions have worked so far. Is there anybody else that has run into this issue, and how you got around it to fix it?Solved22KViews0likes13CommentsInvalid UTF-8 start byte 0xa0
I am not able to fix the below issue in ReadyAPI - Invalid UTF-8 start byte 0xa0.Getting this error message in response. However same request payload is working in Postman. { "replyHeader" : { "rqUID" : null, "transactionRequestTs" : null, "responseTs" : "2022-01-14T08:24:16.645811-05:00" }, "modifiedRequest" : null, "quoteNumber" : null, "policyNumber" : null, "premium" : null, "errorMessages" : [ { "code" : "E010", "desc" : "Invalid UTF-8 start byte 0xa0" } ], "infoMessages" : null, "legalDisclaimer" : null }Solved22KViews0likes2CommentsGetting : ERROR: Exception in request: java.net.SocketException: Connect
Hi All, Recent times I'm facingERROR: Exception in request: java.net.SocketException: Connection reset a lot. Everytime has to run 3 to 4 times to execute the API. I don't know what is the issue here? I tried couple of solution from internet but I couldn't fixed it. Any inputs to resolve this would be appreciated. Because it really kills the automation and has to run every API 3 to 4 times to get success. Tue May 05 16:51:23 UTC 2020: ERROR: Exception in request: java.net.SocketException: Connection reset Tue May 05 16:51:23 UTC 2020: ERROR: An error occurred [Connection reset], see error log for details HTTP-LOG ========= [write] I/O error: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset ERROR-LOG ========= Tue May 05 16:51:23 UTC 2020: ERROR: java.net.SocketException: Connection reset java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at sun.security.ssl.InputRecord.readFully(Unknown Source) at sun.security.ssl.InputRecord.read(Unknown Source) at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.waitForClose(Unknown Source) at sun.security.ssl.HandshakeOutStream.flush(Unknown Source) at sun.security.ssl.Handshaker.kickstart(Unknown Source) at sun.security.ssl.SSLSocketImpl.kickstartHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source) at sun.security.ssl.AppOutputStream.write(Unknown Source) at com.eviware.soapui.impl.wsdl.support.http.SoapUILoggingOutputStream.write(SoapUILoggingOutputStream.java:41) at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:126) at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:138) at org.apache.http.impl.io.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:146) at org.apache.http.impl.BHttpConnectionBase.doFlush(BHttpConnectionBase.java:177) at org.apache.http.impl.DefaultBHttpClientConnection.flush(DefaultBHttpClientConnection.java:185) at org.apache.http.impl.conn.CPoolProxy.flush(CPoolProxy.java:177) at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:240) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:498) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpClient.doExecute(HttpClientSupport.java:248) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:593) at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:661) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:332) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:249) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:130) 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) Above are the errors, I'm receiving every-time.Solved17KViews0likes6Commentsgetting 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.Solved15KViews0likes9CommentsHow i can set header header in multipart/form-data POST request?
When i sent POST request with file and header "Content-Type: multipart/form-data" , and via curl: curl -i -X POST -H "Content-Type: multipart/form-data" -F "file=@/home/Za_Dolber/abon19.txt" http://somehost.somedomain:9876/service/add?ids=1 i see something like this in Wireshark: POST /service/add?ids=1 HTTP/1.1 Host: somehost.somedomain:9876 User-Agent: curl/7.47.0 Accept: */* Content-Length: 200 Expect: 100-continue Content-Type: multipart/form-data; boundary=------------------------c47979a9d477ee1d HTTP/1.1 100 Continue --------------------------c47979a9d477ee1d Content-Disposition: form-data; name="file"; filename="abon19.txt" Content-Type: text/plain 1234567890 --------------------------c47979a9d477ee1d-- HTTP/1.1 200 OK Content-Type: text/plain Content-Length: 2 ok But when i send same request via SoapUI: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_0_1598092424.1491306778334" MIME-Version: 1.0 Content-Length: 269 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_0_1598092424.1491306778334 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 1234567890 ------=_Part_0_1598092424.1491306778334-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents If i try set whole header field in "Headers" i get that header only in first part of request, like this: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_1_662240902.1491314924683" MIME-Version: 1.0 Content-Disposition: name="file"; filename="abon18.txt" Content-Length: 267 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_1_662240902.1491314924683 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 79067212518 ------=_Part_1_662240902.1491314924683-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents How can i change value of "name" field in Content-Disposition header?Solved14KViews0likes2CommentsSet variable in groovy based on parameter from Jenkins
I have a groovy script in my tests which takes the user input to set the environment and project variables. I'm trying to integrate the tests with jenkins, and want to create a parameterized build for the two parameters. So, if someone chooses env as "QA" and project as "testing" in Jenkins, I want thegroovy script to read those values, and run the tests accordingly. I tried finding something related to this in the community but was unable to find it. Anyone has any ideas how this can be achieved?Solved14KViews0likes5Comments