SoapUI Pro Project Solution Collection-change the JDBC Request behavior

change the jdbc request :

1.change the driver name,connection string,query string or assert.

  • the object we will use here is : JdbcRequestTestStep
        TestCase newcase=testRunner.getTestCase();
        JdbcRequestTestStep step1=(JdbcRequestTestStep) newcase.getTestStepByName("");

        String driver=step1.getDriver();
        String constr=step1.getConnectionString();
        String password=step1.getPassword();

        step1.setDriver(""); //if there‘s no driver should set as  step1.setDriver(null)
        step1.setConnectionString("");
        step1.setPassword("");
  • change the jdbc sql statement:
        step1.setQuery("");
        step1.setQueryTimeout("");
  • change the assertion behavior(like xpath string,jquery string):

http://www.soapui.org/apidocs/com/eviware/soapui/model/testsuite/TestAssertion.html

http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/teststeps/assertions/basic/XPathContainsAssertion.html

http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/teststeps/assertions/basic/GroovyScriptAssertion.html

        int totalassert=step1.getAssertionCount();
        for(int k=0;k<totalassert;k++){
            TestAssertion asserts=step1.getAssertionAt(k);
            if(asserts instanceof XPathContainsAssertion ){
                if(asserts.getName().contains("Check count")){
                    String originalxpath=((XPathContainsAssertion) asserts).getPath();
                    String newxpath=originalxpath.replaceAll("Row", "Row2");
                    ((XPathContainsAssertion) asserts).setPath(newxpath);
                }
            }
        }
时间: 2024-10-09 19:50:50

SoapUI Pro Project Solution Collection-change the JDBC Request behavior的相关文章

SoapUI Pro Project Solution Collection &ndash;Easy develop Groovy Script to improve SoapUI ability

As you know the groovy script and java script language is the soapui supported .but unfortunately Soapui's groovy editor had not provided a better editor to write the groovy script. there are two approaches you can take to write your own groovy scrip

SoapUI Pro Project Solution Collection-Custom project and setup

import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import com.eviware.soapui.SoapUI; import com.eviware.soapui.SoapUIProSettings; import com.eviware.soapui.impl.wsdl.WsdlProjectPro; import com.eviware.soapui.impl.wsdl.suppor

SoapUI Pro Project Solution Collection-access the soapui object

Technorati 标签: Soapui pro,web service,apI Testing

SoapUI Pro Project Solution Collection-DataSource(jdbc,excel)

here give a solution for excel file change the excel configuration these: Set Excel file path in current project location: ${projectDir}//Projectname//your excel file name Excel Worksheet,Start at cell,Ignore Empty:

SoapUI Pro Project Solution Collection-XML assert

in soapui the XML object used here is from  org.w3c.dom package so you need to read this article carefully before we can use xml object very well. http://www.w3schools.com/dom/ http://www.w3schools.com/dom/dom_nodetype.asp Node Types - Return Values

jmeter(十一)JDBC Request之Query Type

工作中遇到这样一个问题: 需要准备10W条测试数据,利用jmeter中的JDBC Request向数据库中批量插入这些数据(只要主键不重复就可以,利用函数助手中的Random将主键的ID末尾五位数随机插入), 响应数据报错:Can not issue data manipulation statements with executeQuery().后来查阅了很多资料,才发现跟JDBC Request中的Query Type类型选择有关: 最后得出的结论是:如果SQL语句是update.inser

jmeter jdbc request 如何运行多个sql

database url:jdbc:mysql://127.0.0.1:3306/api?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8 注意:太低版本的mysql和jdbc不支持,最好用最新版的 JDBC Request 这个Sampler可以向数据库发送一个jdbc请求(sql语句),并获取返回的数据库数据进行操作.它经常需要和JDBC Connection Configuration配置原件(配置数据库连接的

转:JDBC Request使用方法

1.   下载mysql jar包 下载mysql jar包 http://dev.mysql.com/downloads/connector/j/ 网盘下载地址:mysql-connector-java-commercial-5.1.25-bin.jar 查看jar包支持的mysql版本: http://dev.mysql.com/doc/connector-j/en/connector-j-versions.html 查看mysql数据库版本:SELECT VERSION(); 注:如果下载

jmeter jdbc request使用详解

1.在使用 jdbc request之前需要加载一个jar包 在test plan中将jar包引入到classpath中 2.创建一个JDBC Connection Configuration Variable Name: 变量名称,需要变量名绑定到池.需要唯一标识.与JDBC取样器中的相对应,决定JDBC取样的配置.简单理解就是在JDBC request的时候确定去哪个绑定的配置. MaxNumber of Connection: 数据库最大链接数 PoolTimeout: 数据库链接超时,单