September 19, 2020

Data - Driven test suite with set up Script in SoapUI



DATA DRIVEN CONCEPT----

Quite simply put, data-driven testing is when you store test data (input, expected output, etc) in some external storage (database, spreadsheet, xml-files, etc) and then use that data iteratively in your tests when running them. For example to test your phone-lookup service, you might have a list of names and expected phone-numbers in a database which you would use to "drive" your test, checking that each name gets the right phone-number back.

Here,I am creating a CSV file and named as input file. I add groovy test script to it. let's  create variable input variable Path and call the test runner. I have defined the property in test suite and Iam going to get that property value and read the data out of that file and convert into string.

Read data and setting the property value from that file. Each times it adds the value and run the test case and loop through this file and put the test case name which we want to use for our test. In this case I used Numconvert. It is performing function what I want .



This is the test case -- I am using test suite property invalue that gives the value from our csv file and outvalue that contains NumberTodollar 




lets use set up script, I am reading in the file and put result in our test case property .. 
get handle to the file and create file objects and open the file path and make an array and that will read each line from that array and we can assert to check the number of lines. 





No comments:

Post a Comment

Please let me know if you have any doubts.

Key concepts in Pipeline

 1. Agent- To build your code or deploy your software using azure pipelines, you need at least one agent. Two types of agent- Microsoft host...