SoapUI Pro Project Solution Collection-change the JDBC Request behavior

Source: Internet
Author: User
Tags soapui wsdl

Change the JDBC Request:

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

    • The object we'll 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

inttotalassert=Step1.getassertioncount ();  for(intk=0;k<totalassert;k++) {Testassertion asserts=Step1.getassertionat (k); if(assertsinstanceofxpathcontainsassertion) {                if(Asserts.getname (). Contains ("Check count") ) {String Originalxpath=((xpathcontainsassertion) asserts). GetPath (); String Newxpath=originalxpath.replaceall ("Row", "Row2");                ((xpathcontainsassertion) asserts). SetPath (Newxpath); }            }        }

SoapUI Pro Project Solution Collection-change the JDBC Request behavior

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.