0

我正在编写一个脚本,以在 SoapUI 4.5.1 中同时跨多个项目自动运行多个 TestSuite:

import com.eviware.soapui.impl.wsdl.panels.testsuite.*;

def properties = new com.eviware.soapui.support.types.StringToObjectMap();
def currentProject = testRunner.getTestCase().testSuite.getProject();
def workspace = currentProject.getWorkspace();

def otherProject = workspace.getProjectByName('Project 1');
def otherTestSuite = CGReportsProject.getTestSuiteByName('TestSuite 1');

otherTestSuite.run(properties, true);

但是,我也尝试为脚本运行的每个测试套件打开测试套件面板,以允许对套件的进度进行可视化跟踪。那就是我遇到麻烦的地方:

ProWsdlTestSuitePanelBuilder.buildDesktopPanel(otherTestSuite);

此特定行引发错误:

groovy.lang.MissingMethodException: No signature of method:
static com.eviware.soapui.impl.wsdl.panels.testsuite.
ProWsdlTestSuitePanelBuilder.buildDesktopPanel() is
applicable for argument types: 
(com.eviware.soapui.impl.wsdl.WsdlTestSuitePro) values:
[com.eviware.soapui.impl.wsdl.WsdlTestSuitePro@1d0b2bc6] 
Possible solutions: 
buildDesktopPanel(com.eviware.soapui.impl.wsdl.WsdlTestSuitePro),
buildDesktopPanel(com.eviware.soapui.model.ModelItem),
buildDesktopPanel(com.eviware.soapui.impl.wsdl.WsdlTestSuite),
buildDesktopPanel(com.eviware.soapui.model.ModelItem),
buildDesktopPanel(com.eviware.soapui.impl.wsdl.WsdlTestSuite),
buildDesktopPanel(com.eviware.soapui.model.ModelItem)
error at line: 12

我的意思是,我向 ProWsdlTestSuitePanelBuilder.buildDesktopPanel() 抛出的 WsdlTestSuitePro 实例由于某种原因未被接受 - 但我不知道为什么。

在这一点上,我也不确定 ProWsdlTestSuitePanelBuilder.buildDesktopPanel() 是否真的是我想要的,但它是唯一需要 WsdlTestSuitePro 的 UI 构建器,因为这显然是我所有的测试套件。

4

1 回答 1

0

好的,所以这属于新手类别。我没有注意到 buildDesktopPanel 是静态的这一事实。

但是,我设法解决了这个问题并创建了最终产品:

// Create a UISupport container for all the panels we'll be showing

def UIDesktop = new com.eviware.soapui.support.UISupport();

// Basic environment information

def properties = new com.eviware.soapui.support.types.StringToObjectMap();
def currentProject = testRunner.getTestCase().testSuite.getProject();
def workspace = currentProject.getWorkspace();

// Get the various Projects we'll be using

def OtherProject = workspace.getProjectByName('Other Project');

// Get the various TestSuites we'll be running

def OtherTestSuite = OtherProject.getTestSuiteByName('Other Test Suite');

// Generate the Panels for the Testsuites

def TestSuitePanel = new com.eviware.soapui.impl.wsdl.panels.testsuite.ProWsdlTestSuiteDesktopPanel(OtherTestSuite);

// Show TestSuite Panels

UIDesktop.showDesktopPanel(TestSuitePanel);

// Run the Testsuites

OtherTestSuite.run(properties, true);
于 2013-06-27T16:59:45.957 回答