如何在免费版的Soap UI中从datebase获取值?(How to get values from datebase in free version of Soap UI?)

编程入门 行业动态 更新时间:2024-10-23 01:49:59
如何在免费版的Soap UI中从datebase获取值?(How to get values from datebase in free version of Soap UI?)

我只有一个可用的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]}

更多推荐

本文发布于:2023-08-07 19:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465986.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:免费版   如何在   Soap   UI   version

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!