我只有一个可用的Soap Ui免费版本。 我在自动Web服务测试中为替代帐户中的不同参数努力工作。 目前它通过随机值生成值。
我想使用从数据库中下载的值,如果它在pro版本中是微不足道的,不幸的是免费版本被剥离,我不确定使用groovy脚本 。
@编辑 - 评论中的建议
我尝试通过JDBC Request配置,但我对connection string: field中的语法一无所知
I have only a free version of Soap Ui available. I am struggling with substitution account for different parameters in automatic webservice tests. At the moment it generates values via random values.
I would like to use the values of downloading from the database, if it is trivial in the pro version, unfortunately the free version is stripped down and I'm not sure about the use of groovy script.
@Edit - suggestion in comment
I tried configure via JDBC Request, but i dont have any idea about syntax in connection string: field
最满意答案
专业版soapUI中的JDBC配置面板与您的屏幕截图几乎完全相同,而连接字符串仅仅是一个标准的JDBC连接字符串,您已拥有该字符串。 如果需要替换字符串中的属性,请尝试:
jdbc:mysql://localhost:3306/SID?user=${#Project#databaseUsername}&password=${#Project#databasePassword}
在这种情况下, databaseUsername和databasePassword是项目级别属性。 有关语法的更多信息,请参阅https://www.soapui.org/docs/functional-testing/properties/working-with-properties.html 。
而且,JDBC响应将是一个XML负载,如下所示:
<Results> <ResultSet fetchSize="0"> <Row rowNumber="1"> <TABLE.COLUMN>41</TABLE.COLUMN> </Row> <Row rowNumber="2"> <TABLE.COLUMN>42</TABLE.COLUMN> </Row> </ResultSet> </Results>您将能够使用XPath从中提取值,如下所示:
${jdbcTestStep#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/TABLE.COLUMN[1]}The JDBC configuration panel in the Pro version of soapUI is virtually identical to your screen shot, and the connection string is just a standard JDBC connection string, which you already have. If you need to substitute properties in the string, try:
jdbc:mysql://localhost:3306/SID?user=${#Project#databaseUsername}&password=${#Project#databasePassword}
In this case, databaseUsername and databasePassword are project level properties. See https://www.soapui.org/docs/functional-testing/properties/working-with-properties.html for more about the syntax.
And, the JDBC response will be an XML payload that looks like:
<Results> <ResultSet fetchSize="0"> <Row rowNumber="1"> <TABLE.COLUMN>41</TABLE.COLUMN> </Row> <Row rowNumber="2"> <TABLE.COLUMN>42</TABLE.COLUMN> </Row> </ResultSet> </Results>You'll be able to extract values from it using XPath like:
${jdbcTestStep#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/TABLE.COLUMN[1]}更多推荐
发布评论