【问题标题】:SoapUI and Maven Integration - LicenseSoapUI 和 Maven 集成 - 许可证
【发布时间】:2019-10-31 08:54:50
【问题描述】:

我正在尝试集成 SoapUI(Community Version) 和 Maven,同样,我已经将 SOAP UI 项目 .xml 文件放入了 maven 的项目中,这是我的文件我写过。

Groovy 脚本,

import java.io.* 
import jxl.* 
import jxl.write.* 
import java.text.SimpleDateFormat  
//get 
log.info("=======================test started for get=======================") 

def f_g=new File("/Volumes/Kanchan/sample-excel/sample.xls");   ///97-2013 workbook xls 
def wk_g= Workbook.getWorkbook(f_g) 
def ws_g=wk_g.getSheet("Sheet1") 
r_g=ws_g.getRows()  //max row number   

for(def i=1;i<r_g;i++) 
{     
    log.info "last row number - "+r_g    
    Cell c1=ws_g.getCell(0,i)     
    log.info c1.getContents()          
    def get = new URL("http://thetestingworldapi.com/api/technicalskills/"+c1.getContents()).openConnection();     
    def getRC = get.getResponseCode();     
    log.info("code is - "+getRC);     
    if(getRC.equals(200)) {       
        log.info(get.getInputStream().getText());     
    }  
}  

下面是我的 pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear</groupId>
            <artifactId>ready-api-maven-plugin</artifactId>
            <version>2.8.0</version>
            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>

                    <configuration>
                        <projectFile>${FileName}</projectFile>
                        <outputFolder>${basedir}/target/surefire-reports</outputFolder>

                        <!-- Specifies the format of the report. Possible values: PDF, XLS, 
                            HTML, RTF, CSV, TXT and XML. -->
                        <reportFormat>PDF</reportFormat>

                        <reports>${basedir}/target/surefire-reports</reports>
                        <reportName>Project Report</reportName>
                        <printReport>true</printReport>
                        <readyApiProperties>

                            <property>
                                <!-- Required. A folder with ReadyAPI executable files. -->
                                <!-- Used to run a local installation of ReadyAPI. -->
                                <name>soapui.home</name>
                                <value>/Applications/SoapUI-5.5.0.app/Contents/java/app/bin</value>
                            </property>
                        </readyApiProperties>

                        <!-- ========= Additional elements ============= -->

                        <!-- Commands ReadyAPI to generate JUnit-style reports. -->
                        <junitReport>true</junitReport>

                        <!-- Specifies the name of the test suite to be run. -->
                        <!-- <testSuite></testSuite> -->

                        <!-- Specifies the name of the test case to run. -->
                        <!-- <testCase></testCase> -->

                        <!-- Specifies the tags of the test cases to be run. -->
                        <!-- Use the '&amp;&amp;', '||', and '!' operators to apply the AND, 
                            OR and NOT conditions to tags respectively, or list tags separated by commas 
                            to apply the AND condition. To change the order of operations, use parentheses. -->
                        <!-- <tags><param>TestCase tag1 &amp;&amp; (tag2 || tag3) !tag4</param></tags> -->

                        <!-- Overrides the service endpoints specified in the test. -->
                        <!-- <endpoint></endpoint> -->

                        <!-- Overrides the host specified in the the test. -->
                        <!-- <host></host> -->

                        <!-- Overrides the user name for all requests. -->
                        <!-- <username></username> -->

                        <!-- Overrides the passwords for all requests. -->
                        <!-- <password></password> -->

                        <!-- Overrides the domain used for requests. -->
                        <!-- <domain></domain> -->

                        <!-- If true, commands Maven to export all the requests. -->
                        <!-- <exportAll></exportAll> -->

                        <!-- Specifies the SoapUI settings file to use. Required for custom 
                            ReadyAPI reports. -->
                        <!-- <settingsFile></settingsFile> -->

                        <!-- Specifies the type of the WSS password. -->
                        <!-- <wssPasswordType></wssPasswordType> -->

                        <!-- Specifies the password for an encrypted project. -->
                        <!-- <projectPassword></projectPassword > -->

                        <!-- Specifies the password for an encrypted settings file. -->
                        <!-- <settingsPassword></settingsPassword> -->

                        <!-- Specifies the value of a global property for the test run. -->
                        <!-- <globalProperties> <value>Sample Project Property=My sample value</value> 
                            </globalProperties> -->

                        <!-- Specifies the value of a project property for the test run. -->
                        <!-- <projectProperties> <value>Some Property=My Sample Value</value> 
                            </projectProperties> -->

                        <!-- Saves the project after the test run. -->
                        <!-- <saveAfterRun></saveAfterRun> -->

                        <!-- If true, commands Maven to continue -->
                        <!-- the test run even if an assertion triggers. -->
                        <!-- <testFailIgnore>true</testFailIgnore> -->

                        <!-- Enables HTML coverage reports. Only available in ReadyAPI Pro. -->
                        <!-- <coverage></coverage> -->

                        <!-- Specifies the environment to use in the test run. -->
                        <!-- Only available in ReadyAPI Pro. -->
                        <!-- <environment></environment> -->

                        <!-- If true, ReadyAPI will not send usage statistics. -->
                        <!-- <optOutUsageStatistics></optOutUsageStatistics> -->

                        <!-- ========= /Additional elements ============= -->

                    </configuration>
                </execution>
            </executions>
        </plugin>

    </plugins>

</build>

当我执行它时,它会请求许可证,并显示以下消息。

[INFO] Started 'LifecycleManager@422266669'
No valid SoapUI license exists.
Please enter absolute path of the license file (.zip or .key):

有解决办法吗?

提前谢谢:)

【问题讨论】:

    标签: maven soapui


    【解决方案1】:

    Ready API 是 SoapUI 的付费许可版本。 请尝试以下插件,这将适用于开源版本。 也可以参考这个link

    <plugin>
    <groupId>com.smartbear.soapui</groupId>
    <artifactId>soapui-pro-maven-plugin</artifactId>
    <version>5.1.1</version>
    </plugin>
    

    【讨论】:

    • 名称中的-pro指的是授权版本,你需要去掉它!此外,要使其正常工作,您需要指向 SmartBear 存储库。
    • 那不是免费版。