Tips for SoapUI, Groovy and installing JDBC on Mac

SoapUI

SoapUI


SoapUI is a good (but too complicated) API test tool. You can use it for your usual integration test or regression test.

Install it by the following link:
http://sourceforge.net/projects/soapui/files/

Groovy


Sometimes you want to do something further. SoapUI allows you to write the Groovy script to do whatever you want. For instance, assert your responses (JSON format) from APIs.
import groovy.json.JsonSlurper 
def response = messageExchange.response.responseContent
def slurper = new JsonSlurper()
def json = slurper.parseText response
assert json.status_code == 200

Installing and Using JDBC Drivers for MySQL on Mac


If you want to use a JDBC connection and do some DB operations. Please follow few steps below.

  1. Download the drivers you need.
    http://www.soapui.org/Working-with-soapUI/jdbc-driver-list.html
  2. Decompress the file into a temp directory.
  3. Copy the driver to SoapUI's ext directory.
    cp ~/Downloads/mysql-connector-java-5.1.23-bin.jar /Applications/SmartBear/soapUI-4.5.1.app/Contents/Resources/app/bin/ext
  4. Add a new Test Step: JDBC Request into your Test Case.
  5. Fulfill the info:
    Driver: 
    com.mysql.jdbc.Driver
    Connection String: 
    jdbc:mysql://localhost:3306/mydb?user=iamroot&password=mypass
  6. Write your SQL queries.
  7. Done.

留言