SOAPUI TestRunner test case count and runner (teardown) test case count mismatch
Hi, Structure and flow of Project TestSuite Test Case 1 Test Step (REST request) Test Case 2 Test Step (REST Request) Test Step (Groovy script) (this script will call and execute Test Case 3 based on condition, test case 3 will be disabled state, if condition pass it will enable test case and execute and again it will be disabled Test Case 3 Test Step (REST Request) Problem Statement : If we execute above TestSuite via 'SOAPUI-TestRunner', number of test case executed count is correct, in our sample case : Total Test case count : 4 (which is correct, since test case 3 got executed twice via groovy script (Test Case 1 + Test case 2 + Test case 3 + Test Case 3), but if we try to get total Test case executed count from teardown its showing as 'Test case count : 2 Teardown script not considering test cases which got executed via groovy script Attached snapshots for reference Any help or support would be great, thanks3.4KViews0likes7Commentsjava.lang.RuntimeException: Unable to refresh expired access token.
Hi all. I am trying to Automate the REST APIs (Services) that uses User Level Token Authentication using using Groovy Script and TestRunner.bat file in SoapUI. Groovy Script: where I am generating and hitting the request. NOTE: The below are passed as parameters to this method. strTestStepName, strPathforResp, profilename, respTimepath try { def authContainer = testRunner.testCase.testSuite.project.OAuth2ProfileContainer def profileName = context.expand( '${#Project#profileName}' ) def authProfile = authContainer.getProfileByName(profilename) def oAuthClientFacade = new OltuOAuth2ClientFacade() oAuthClientFacade.requestAccessToken(authProfile) Thread.sleep(1000) def accessToken = authProfile.getAccessToken() log.info accessToken def validate = testRunner.runTestStepByName(strTestStepName); resptime(validate,respTimepath); def httpResponseHeaders = context.testCase.testSteps[strTestStepName].testRequest.response.responseHeaders def strhttpStatus = httpResponseHeaders["#status#"].toString() strResponseXML = testRunner.testCase.testSteps[strTestStepName].testRequest.response.getContentAsString(); strResponseXML = strResponseXML.trim(); log.info strResponseXML fWriteToFile(strPathforResp+".txt",strResponseXML) //--> Writing Response to Local for Further validations } catch(Exception e) { log.info e.message; } The User Token is generated without any issues when I try it manually. But, when I try to run/generate the User Level Token via Groovy Script with TestRunner.bat, I am getting inconsistent Errors - Please see below. Instance#1: Error 2017-08-17 20:45:21,909 INFO [OAuth2RequestFilter] The access token has expired, trying to refresh it. 2017-08-17 20:45:22,586 ERROR [WsdlSubmit] Exception in request: java.lang.RuntimeException: Unable to refresh expired access token. 2017-08-17 20:45:22,587 ERROR [SoapUI] An error occurred [Unable to refresh expired access token.], see error log for details 2017-08-17 20:45:22,589 ERROR [errorlog] java.lang.RuntimeException: Unable to refresh expired access token. java.lang.RuntimeException: Unable to refresh expired access token. at com.eviware.soapui.impl.wsdl.submit.filters.OAuth2RequestFilter.reloadAccessToken(OAuth2RequestFilter.java:140) at com.eviware.soapui.impl.wsdl.submit.filters.OAuth2RequestFilter.filterRestRequest(OAuth2RequestFilter.java:68) at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterAbstractHttpRequest(AbstractRequestFilter.java:41) at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:33) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:172) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119) at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:79) at com.eviware.soapui.impl.rest.RestRequest.submit(RestRequest.java:192) at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:794) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStepByName(AbstractTestCaseRunner.java:200) at com.eviware.soapui.model.testsuite.TestCaseRunner$runTestStepByName.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at Script1.fRunandAPICResponse(Script1.groovy:113) at Script1$fRunandAPICResponse.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153) at Script1.run(Script1.groovy:58) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141) at com.eviware.soapui.model.testsuite.TestStep$run.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at Script1.run(Script1.groovy:7) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:595) at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:565) at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:397) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:204) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:139) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:114) at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:120) Caused by: org.apache.oltu.oauth2.common.exception.OAuthSystemException: org.apache.http.client.ClientProtocolException at org.apache.oltu.oauth2.httpclient4.HttpClient4.execute(HttpClient4.java:119) at org.apache.oltu.oauth2.client.OAuthClient.accessToken(OAuthClient.java:65) at org.apache.oltu.oauth2.client.OAuthClient.accessToken(OAuthClient.java:55) at com.eviware.soapui.impl.rest.actions.oauth.OAuth2TokenExtractor.refreshAccessToken(OAuth2TokenExtractor.java:192) at com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade.refreshAccessToken(OltuOAuth2ClientFacade.java:72) at com.eviware.soapui.impl.wsdl.submit.filters.OAuth2RequestFilter.reloadAccessToken(OAuth2RequestFilter.java:119) ... 42 more Caused by: org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) at org.apache.oltu.oauth2.httpclient4.HttpClient4.execute(HttpClient4.java:103) ... 47 more Caused by: org.apache.http.auth.MalformedChallengeException: Authentication challenge is empty at org.apache.http.impl.auth.RFC2617Scheme.parseChallenge(RFC2617Scheme.java:71) at org.apache.http.impl.auth.AuthSchemeBase.processChallenge(AuthSchemeBase.java:115) at org.apache.http.impl.auth.BasicScheme.processChallenge(BasicScheme.java:89) at org.apache.http.impl.client.DefaultRequestDirector.processChallenges(DefaultRequestDirector.java:1183) at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1078) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:482) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) ... 50 more Instance#2: Error 2017-08-17 17:37:26,559 INFO [log] 2017-08-17 17:37:27,229 WARN [HttpClientSupport$SoapUIHttpClient] Authentication error: Unable to respond to any of these challenges: {bearer=WWW-Authenticate: Bearer} It would help if anyone could assist me in resolving this (or) let me know if there are any workarounds for this issue Note: Due to Security Reasons I cannot share the API details/project files here.1.7KViews0likes0CommentstestRunner.testCase.getTestStepByName("my").setPropertyValue("id","42") not working in script ...
Hello, I tried to write a groovy script an to set values of a testrequest, and to excecute that afterwards. It looks like this: testRunner.testCase.getTestStepByName("my").setPropertyValue("id", "42") def whatis = testRunner.testCase.getTestStepByName("my").getPropertyValue( "id" ) log.info "Value of id by testRunner.testCase.getPropertyValue: "+whatis testRunner.runTestStepByName("my") The result in the log gives Value of id by testRunner.testCase.getPropertyValue: null where I expected it to be 42, so also running "my" is not possible since it has no property values Where is the problem? I don`t see where and what is going wrong? Thanks, P.S. "my" looks like this: <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ilUserAdministration"> <soapenv:Header/> <soapenv:Body> <urn:addGroup soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <id xsi:type="xsd:string">?</id> </urn:addGroup> </soapenv:Body> </soapenv:Envelope>Solved5.6KViews0likes3CommentsGetting Http 400 Bad Request response while running TestRunner
I am getting this error while running a testsuite using the Launch TestRunner option. SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 400 Bad Request. There are 5 test steps. Out of 5 test steps, the 1st step runs fine and then I get this message for the rest of the steps.1.5KViews0likes3CommentsHow to enable TLSv1.2 for Testrunner
I have configured the vmoption file. Its working fine when i trigger request directly using play button. But while same testcase fails when I ran through Testrunner with SSLhandshake error. Please let me know if there is any configuration to be done Testrunner to support tlsv1.2Solved5.6KViews0likes2Commentstestrunner hangs on INFO [SoapUITestCaseRunner] running step [Property Transfer test case]
Using SoapUI free version, Testrunner hangs on this step: 10:11:12,366 INFO [SoapUITestCaseRunner] running step [Property Transfer test case] Notes/Observations: Configuring log4j from [C:\Program Files\SmartBear\SoapUI-5.2.1\bin\soapui-log4j.xml] 10:11:05,758 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\charles\soapui-settings.xml] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 10:11:07,542 INFO [PluginManager] Adding plugin from [C:\Users\charles\.soapuios\plugins\soapui-swagger-plugin-2.2-dist.jar] 10:11:07,542 INFO [PluginManager] Adding plugin from [C:\Users\charles\.soapuios\plugins\ready-mqtt-plugin-dist.jar] 10:11:08,341 ERROR [SoapUI] An error occurred [com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory], see error log for details java.lang.ClassNotFoundException: com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory 10:11:10,145 INFO [PluginManager] 4 plugins loaded in 2604 ms 10:11:10,146 INFO [DefaultSoapUICore] All plugins loaded SoapUI 5.2.1 TestCase Runner runType = SEQUENTIAL 10:11:10,056 ERROR [SoapUI] An error occurred [com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory], see error log for details java.lang.ClassNotFoundException: com.eviware.soapui.plugins.auto.factories.AutoDiscoveryMethodFactory845Views0likes0CommentsTestrunner, Script and "isCommandLine"
[Edit: Clearing up quite a bit] Hi, I am using the latest SoapUI 5.2.1 with its testrunner.bat Manual steps should be ignored from commandline - at least according to the source code of SoapUI 4.0. However, in latest SoapUI they fail. 15:32:09,094 INFO [SoapUITestCaseRunner] running step [Restart ESB (clear state)] 15:32:09,099 ERROR [AbstractTestRunner] Exception during Test Execution java.lang.NullPointerException at com.eviware.x.form.XFormFactory.createDialogBuilder(XFormFactory.java:21) at com.eviware.x.form.support.ADialogBuilder.buildDialog(ADialogBuilder.java:66) at com.eviware.x.form.support.ADialogBuilder.buildDialog(ADialogBuilder.java:51) at com.eviware.soapui.impl.wsdl.teststeps.ManualTestStep.run(ManualTestStep.java:117) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:595) at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:565) at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:397) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:204) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:139) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:114) at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:120) For circumventing the error, I have tried to write a groovy script which tests whether it is called in commandline or not. I've got the condition from http://www.soapui.org/scripting---properties/tips---tricks.html. However, "isCommandLine" is always false in my tests. Groovy Script: def isCommandLine = com.eviware.soapui.SoapUI.isCommandLine log.info("isCommandLine:" + isCommandLine) if (isCommandLine) { log.info("in cmdl"); testRunner.gotoStepByName( "GetStates is Empty" ); } I had a small glimpse on the 4.0 and 5.2.0 source code. I did not find a problem, however. Luckily, I found there the "isStandalone" static property, which seem to contain the correct information. :-) My question: Is "isStandAlone" the correct property to use nowadays? Did I mistake the isCommandline somehow or is there any known bug? MFG (Best regards) Heiko Studt2.4KViews0likes7Comments