我遇到了SoapUi测试用例和Jenkins集成的问题。
我正在通过Ant直接调用测试,它正在工作。但是当我用jenkins打电话给我的蚂蚁时,我得到了一个java.lang.nullpointerexception。
我也尝试通过windows batch命令直接调用ant而不是“invoke ant”
jenkins控制台给我那个
soapui-tests:
[exec] SoapUI Pro 4.6.4 TestCase Runner
[exec] 16:08:45,279 INFO [SoapUI] Adding [C:\ESP_Testware\ESP_Tools\SoapUI-Pro-4.6.4\bin\ext\sqljdbc.jar] to extensions classpath
[exec] 16:08:45,279 INFO [DefaultSoapUICore] Creating new settings at [C:\soapui-settings.xml]
[exec] 16:08:45,997 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\ESP_Testware\ESP_Tools\Jenkins\jobs\ESP_QA_WS_REGRESSION\scripts]
[exec] 16:08:45,997 INFO [DefaultSoapUICore] Adding listeners from [C:\ESP_Testware\ESP_Tools\SoapUI-Pro-4.6.4\bin\listeners\demo-listeners.xml]
[exec] 16:08:48,025 INFO [WsdlProject] Loaded project from [file:/C:/ESP_Testware/ESP_Projects/Test-Ws/Multi_1_1_7.xml]
[exec] 16:08:48,586 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\ESP_Testware\ESP_Tools\Jenkins\jobs\ESP_QA_WS_REGRESSION\scripts]
[exec] 16:08:52,018 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [EnvDev 1_1_7]
[exec] 16:08:52,018 INFO [SoapUIProTestCaseRunner] Running TestSuite [MS_TEST], runType = SEQUENTIAL
[exec] 16:08:52,034 INFO [SoapUIProTestCaseRunner] Running SoapUI testcase [LogOn]
[exec] 16:08:52,034 INFO [SoapUIProTestCaseRunner] running step [LogOn - Request 1]
[exec] 16:08:52,143 ERROR [WsdlSubmit] Exception in request: java.lang.NullPointerException
[exec] java.lang.NullPointerException
[exec] 16:08:52,143 ERROR [SoapUI] An error occurred [java.lang.NullPointerException], see error log for details
[exec] at com.btr.proxy.search.browser.ie.IEProxySearchStrategy.createPacSelector(IEProxySearchStrategy.java:70)
[exec] at com.btr.proxy.search.browser.ie.IEProxySearchStrategy.getProxySelector(IEProxySearchStrategy.java:44)
[exec] 16:08:52,143 INFO [SoapUIProTestCaseRunner] Assertion [SOAP Response] has status UNKNOWN at com.btr.proxy.search.ProxySearch.getProxySelector(ProxySearch.java:193)
[exec]
[exec] 16:08:52,143 INFO [SoapUIProTestCaseRunner] Assertion [Check for existance of [a:Token]] has status UNKNOWN
[exec] at com.eviware.soapui.impl.wsdl.support.http.CompositeHttpRoutePlanner.getProxySelector(CompositeHttpRoutePlanner.java:72)
[exec] 16:08:52,143 ERROR [SoapUIProTestCaseRunner] LogOn - Request 1 failed, exporting to [C:\ESP_Testware\ESP_Log\MS_TEST-LogOn-LogOn__Request_1-0-FAILED.txt] at com.eviware.soapui.impl.wsdl.support.http.CompositeHttpRoutePlanner.determineRoute(CompositeHttpRoutePlanner.java:59)
[exec]
[exec] at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:709)
[exec] 16:08:52,143 INFO [SoapUIProTestCaseRunner] Finished running SoapUI testcase [LogOn], time taken: 96ms, status: FAILED at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:356)
[exec]
[exec] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
[exec] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
[exec] 16:08:52,159 INFO [SoapUIProTestCaseRunner] TestSuite [MS_TEST] finished with status [FAILED] in 109ms at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:238)
[exec]
[exec] at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:348)
[exec] at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:318)
[exec] at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:232)
[exec] at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
[exec] at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
[exec] at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:238)
[exec] at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:417)
[exec] at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:235)
[exec] at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
[exec] at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
[exec] at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
[exec] at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
[exec] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[exec] at java.util.concurrent.FutureTask.run(Unknown Source)
[exec] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[exec] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[exec] at java.lang.Thread.run(Unknown Source)
SoapUi测试用例日志给我
Status: FAILED
Time Taken: 96
Size: 0
Timestamp: Fri Jan 17 16:08:52 EST 2014
TestStep: LogOn - Request 1
----------------- Messages ------------------------------
java.lang.NullPointerException
----------------- Properties ------------------------------
Encoding: UTF-8
Endpoint: http://dev.rxassyst.com/Blackboxqa/1_1_1/session/RxAssyst.svc
---------------- Request ---------------------------
<soapenv:Envelope
xmlns:rxas="http://schemas.datacontract.org/2004/07/RxAssystLib.Contracts.Data"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:User>
<rxas:Password>Blackbox</rxas:Password>
<rxas:UserName>jm</rxas:UserName>
</tem:User>
<tem:UserInfo field:nil="true" xmlns:field="http://www.w3.org/2001/XMLSchema-
instance"/>
</soapenv:Body>
</soapenv:Envelope>
---------------- Response --------------------------
- missing response / garbage collected -
答案 0 :(得分:4)
正如venergiac指出的那样,阅读代理设置似乎是一个问题。默认情况下,SoapUI会自动尝试确定代理设置。
如果您不使用代理,则可以通过关闭代理来解决问题。您可以通过向testrunner提供带-t参数的soapui-settings.xml文件来实现。生成文件的最简单方法是从安装了SoapUI的本地计算机上的主文件夹中复制设置文件。确保在复制设置文件之前在SoapUI中禁用了代理。