DB Explorer

The Database Explorer Tool allows you to query multiple types of databases in order to verify database contents in your test automation projects. The DB Explorer tool supports query requests to multiple databases however only MYSQL has native support in the tool. Databases such as DB2, PostgreSQL, SQL Server, Oracle can also be supported via configuration using database drivers we provide.

If the system (machine/vm) running the Functionize DB Jar file is accessible via a public endpoint then the configuration to test the database will only require the IP Address and Port of the Functionize DB Service system.

DBET1.png

However, in most cases access to the internal database is restricted. In such scenarios a Functionize Proxy or Tunnel configuration can be implemented.

DBET2.png

DBET3.png

 

Access

  1. Go to functionizeapp.com/tools/dbexplorer

The DB Explorer Request form contains the following fields:

  1. Server IP

  2. Server Type (drop-down selection)

  3. DB Name

  4. Credentials (Username and Password)

  5. Query

As noted above, only MYSQL is supported natively within the tool. If you select another Server Type, the fields below will appear. See Advanced Database Integration below.

  1. Functionize DB Service
  2. Proxy IP
  3. Proxy Port

Fill in all fields, then click Launch Request.

mceclip0.png

Query Result

The Response Data will load. Click the + icon to view the response details.

mceclip1.png

The Response Data will display what is returned from the database request. In this example, we can see the following data has been returned and we could proceed to perform validations on it within the test case. You may verify or store this resulting data as you would with any other site.

  1. order_id

  2. firstname

  3. lastname

  4. date_added

  5. total

mceclip2.png

 

Advanced Database Integration

If integrating with a JDBC interfacing database such as DB2, you will need to host a basic Whitelisted Proxy or Functionize Tunnel service to facilitate the communication between the Functionize Runtime environment and your database. This service will need to be set up in an environment where it can communicate directly with the database.

When using this configuration, the service that you install exposes a single endpoint to act as a passthrough to the database.

DB_Integration.png

Whitelist Proxy

For this configuration, we will provide you with a Proxy that can be whitelisted in your DMZ to allow access to the Functionize DB service host that will in turn route the database queries to the appropriate database.

DBET8.png

Functionize Tunnel

For this configuration, we will provide you with a Proxy to the Functionize WSS Tunnel endpoint to allow access to the Functionize DB service host that will in turn route the database queries to the appropriate database. The Java JAR file to host the DB Service can be run on the same system where the Tunnel is running.

DBET9.png

 

Prerequisites

A minimum of Java 1.8 must be installed

Java needs to be added in system PATH

 

Installation

  1. Download the .jar file needed for all databases here.
  2. Test connectivity from the server where you would like to host the service
      1. The service can be run temporarily with java -jar functionize_databaseConnectivity.jar from the command line. 
      2. You can use the curl command below to test DB2, MSSql, Oracle, or PostgreSQL connectivity.
        (NOTE: The curl command for Oracle must include the Site Identifier or "sid" parameter.)
  3. Once connectivity is verified, install as a service. Instructions to install as a Linux service are available upon request.
Drivers Available:

For msSQL: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
For Oracle: "oracle.jdbc.driver.OracleDriver"
For DB2 (JDBC4 specification): "com.ibm.db2.jcc.DB2Driver"
For PostgreSQL: "org.postgresql.Driver"

Connectivity Test Command:

curl -H "Content-Type: application/json" -X POST -d '{"sql":"DB_QUERY", "name":"DB_USER_NAME", "password":"DB_USER_PASSWORD", "dbname":"DB_NAME","server":"DB_SERVER_ADDRESS", "dbport": "DB_SERVER_PORT" , "driver":"DB_DRIVER" , "sid": "SITEID"}' http://ADDRESS_OF_SERVICE:2511/query