├── README.md ├── SampleFramework-soapui-project.xml └── soapui.xls /README.md: -------------------------------------------------------------------------------- 1 | # SoapUIFramework 2 | Excel Data Driven Framework for API Automation using SoapUi and groovy 3 | 4 | PreRequisite: 5 | 1. Make sure to add jxl.jar to the soapuiinstallationfolder/lib and soapuiinstallationfolder/bin/ext 6 | 2. Soapui installation folder will be your C:\Program Files\SmartBear\SoapUI-5.5.0 unless you installed in other folders 7 | 3. Download the project xml and excel to your machine and make sure the soapui.xls also placed in the same folder where you placed the project xml file. 8 | 4. Import the project in to your workspace. 9 | 10 | Running the suite: 11 | 12 | 1. runme groovy script file under TestRunner testcase takes care of reading the values from excel and driving the tests based on the Yes/No keywords in the excel. 13 | 2. You can also run the TestRunner testcase from cmd. 14 | 15 | Adding more tests: 16 | 17 | 1. Create as many as tests you want in the same suite. 18 | 2. Make sure the tests created in soapui is same as in the excel sheet. 19 | 3. If you add a new test case, make sure to add the below script in the tearDown script of the test case. 20 | 4. If you want to run same test case with multiple test data, use a different iteration in the excel sheet. 21 | 22 | // Code to execute the GenerateCSVReport test step 23 | testRunner.testCase.testSuite.project.testSuites["Library"].testCases["Reporting_Utility"]. 24 | testSteps["GenerateCSVReport"].run(testRunner, context); 25 | 26 | Reports: 27 | 1. Reports will be generated to the folder where the project is placed in the local machine. 28 | 2. Reports are done based on the below article. 29 | https://dzone.com/articles/how-to-achieve-csv-reporting-in-soapui-open-source-1 30 | 3. Request and response bodies are also stored in a notepad file in the results folder along with the csv reports. 31 | 32 | Please contact me if you need any details through mech.amuthansakthivel@gmail.com 33 | 34 | 35 | -------------------------------------------------------------------------------- /SampleFramework-soapui-project.xml: -------------------------------------------------------------------------------- 1 | 2 | https://restcountries.eunamenameTEMPLATEnameapplication/json;charset=utf-8200Responseapplication/json;charset=utf-8404ind:Fault404data404data404data404data404data404data404data<xml-fragment/>https://restcountries.euhttps://restcountries.eu/rest/v2/name/IndiaNo AuthorizationnameSEQUENTIAL<xml-fragment/>https://restcountries.euhttps://restcountries.eu/rest/v2/name/Indiaimport groovy.json.JsonSlurper 75 | 76 | def responseMessage = messageExchange.response.responseContent 77 | def json = new JsonSlurper().parseText(responseMessage) 78 | 79 | assert json.name.toString() != null 80 | No AuthorizationnameCountryCodeResponsegetCountryDetailsByName$.[0].altSpellings[0]namegetCountryDetailsFromCodeJSONPATHtrue<xml-fragment/>https://restcountries.euhttps://restcountries.eu/rest/v2/alpha/INimport groovy.json.JsonSlurper 81 | 82 | def responseMessage = messageExchange.response.responseContent 83 | def json = new JsonSlurper().parseText(responseMessage) 84 | 85 | assert json.name.toString() != null 86 | def value = context.expand('${#TestSuite#countryCode}') 87 | //assert json.name.toString() == valueNo Authorization 88 | 89 | 90 | code// Code to execute the GenerateCSVReport test step 91 | testRunner.testCase.testSuite.project.testSuites["Library"].testCases["Reporting_Utility"]. 92 | testSteps["GenerateCSVReport"].run(testRunner, context);resultpasstestNameTestCase1executeYescountryCodeAndorraSEQUENTIALIteration3 -------------------------------------------------------------------------------- /soapui.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amuthansakthivel/SoapUIFramework/fa93fa34dc5ca700eab4f4ba4f36eac19cc97e58/soapui.xls --------------------------------------------------------------------------------