Introduction
Hey Ninja!!🥷You must have heard about autonomous driving vehicles 🚗, ever wondered how they work??!! They work by following specific predefined rules and behaviours based on real-time situations. In software development and testing, we developers tend to implement automatic logic to reduce human effort. Scripting helps automate testing and saves resources.
Scripts are pieces of code that define sequential commands to execute based on certain conditions. Several libraries are available in ReadyAPI to ease the writing of these scripts. In this blog, we will learn about these libraries and how to load them from external sources.

Pre-installed Script Libraries
ReadyAPI has different Java and Groovy libraries pre-installed in a ready-to-use state. Some of these are imported by default, and some need manual importing.

Already Imported Libraries
Some Java and Groovy libraries are imported by default and ready to be used anytime. The developer does not have to import these libraries manually. ReadyAPI, by default, comes with these libraries, and users do not have to import them specifically into their projects. These are available in all editors in ReadyAPI.
✅ java.io.*
✅ java.lang.*
✅ java.net.*
✅ java.util.*
✅ java.math.BigDecimal
✅ java.math.BigInteger
✅ groovy.util.*
✅ groovy.lang.*
Installed Libraries Ready for Import
These are the pre-installed libraries in ReadyAPI but are not available by default. We first need to import them to use them in our script. Unlike pre-imported libraries, these are available but not yet imported by ReadyAPI. The developer must explicitly import them before using them. We must use the import <library> command to import the desired library. Following are examples of such libraries:
✅ javax.jms.*
✅ java.nio.*
✅ groovy.json.*
✅ groovy.sql.*
✅ groovy.xml.*
✅ org.apache.commons.*
✅ org.apache.http.*
✅ org.apache.activemq.*
Must Read Apache Server
Let's see a sample Groovy script where we import these libraries.
//Hey Ninja, this is a sample Groovy script involving JDBC driver and database
//Import the required library using the import keyword
import groovy.sql.Sql
// Set up database connection properties
def url = 'jdbc:mysql://mydatabase.com/DatabaseVariable'
def user = 'DatabaseUser'
def password = 'DatabasePassword'
def driver = 'com.mysql.jdbc.Driver'
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( driver )
def sql = Sql.newInstance(url, user, password, driver)
sql.close()