Database connection in SOAP UI

数据库连接与Groovy脚本操作示例
本文介绍如何使用Groovy脚本操作数据库,包括设置运行属性、加载外部配置文件、执行SQL查询和数据操作等关键步骤。

Database connection:

In order to show on how to operate database, here creating a sample to present through groovy script.

 

Structure:

1.set run properties script

2.load properties from external file

3.operating db

 

The First, we need to create a property file, for example: i create properties file named DB_TEST_Connectivity.properties, in this file,you can put some configuration information of db in it,as following:

 

url=jdbc:mysql://localhost:3306/test
driver=com.mysql.jdbc.Driver
username=root
password=*****

the Second, we will read data from properties fiel, so firstly need to find the path that properties file stored.

 

 

And then,we will load data from properties file and put them in TestSuite level so that can be shared by all of test case under test suite project, the script is following:

 

Lastly, we can create our sql to access database, the script is as follows:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值