enterprisesfasad.blogg.se

Groovy jxl api
Groovy jxl api





groovy jxl api

Sheet sheet1 = workbook1.getSheet(0) //Index 0 will read the first sheet from the workbook, you can also specify the sheet name with "Sheet1" Workbook workbook1 = Workbook.getWorkbook(new File("C:\\Users\\vija\\Downloads\\Hello.xls")) //file containing the data Import .XmlHolderĭef myTestCase = context.testCase //myTestCase contains the test caseĭef counter,next,previous,size //Variables used to handle the loop and to move inside the file

#Groovy jxl api code#

Copy the below code in the GroovyScript // IMPORT THE LIBRARIES WE NEED This groovy script will have the logic of reading the excel file. Right-click on the test case again and this time→Add Step→Create Groovy Script.This is how it will look after adding all the properties. Double click on the Properties step and create the below properties by clicking the add icon.Right-click on the test case→Add Step→Create Properties.

groovy jxl api

Generate TestSuite with one TestCase for your Operation. Right-click on the Interface→Generate TestSuite.

groovy jxl api

If you don’t have a test case then perform the below step otherwise you can skip this step.Below is what I will be using for testing and my file is located at “C:\\Users\\vija\\Downloads\\Hello.xls”. Create an excel file that will have sample data.Unzip the file, and copy JXL.jar to your SOAPUI installation folder (SOAPUI-folder/lib & SOAPUI-folder/bin/ext) The library name is JXL.jar and it can be downloaded from JXL-JAR We need to import a library to SOAPUI to handle the excel file.I will be using the SOAP UI project that we created as part of In this post, we will read the data from an excel file and pass the different set of data as a request to the web service using groovy scripts. Imagine you are testing a web service, and you want to run the same test with a different data set.







Groovy jxl api