Follow these steps to prepare your first jdbc step in SoapUI
1) Copy & paste the oracle driver jar file in SoapUi’s lib directory
2) Create a jdbc step
example configuration of the newly created jdbc step as follows :
a) Driver: oracle.jdbc.driver.OracleDriver
b) Connection String: jdbc.oracle.thin:email@example.com:1521:XE
Write your query string “select * from departments”
Add assertion with “contains”
Run your step and observe!
You can use variables to your request so that you don’t have to change your request body every time.
Your project > Custom properties
Add your project variables
You can add variables by these steps:
1) keep your cursor on your request location (where you want to put your project variables)
2) Right click , use “Get Data..” , choose your variables from project section.
If you want to access your mock service request pragmatically via Groovy Script step and perform assertion, then you can following this sample code.
def mockService =testRunner.testCase.testSuite.project.getMockServiceByName("SampleMockService")
log.info "result was: " +requestContent;
if(requestContent.contains( "Your Key Word" ))
File file = new File("C:/temp/ExampleResult.txt")