free seo tool

soapUI DataSource TestStep

DataSource step allows the user to read data from different external sources (Databases, Excel files, directories, etc). DataSource step pairs up with DataSource Loop to allow for iterating over a sequence of TestSteps that should be executed for each row of values available in the DataSource. 
To make it simple if you are familiar with a for loop on any programming language, think it in that way. Imagine the starting of the for loop is the DataSource step and instead of the vaiable in for loop think that the data is retrieved from external sources. End of the for loop can be compared to DataSource Loop.

Let us see an example of DataSource and DataSource Loop.


See the below image it has a DataSource and DataSource Loop and there is one TestRequest in between them.

soapUI DataSource and DataSource Loop

The steps between DataSource and DataSource Loop (In this case step "TestRequest") will be executed based on the number of entries retrieved by DataSource.
As mentioned above, DataSource can be configured for different input sources, lets see how can we configure this using an excel sheet. See the below image.

soapUI DataSource Excel

While selecting the excel file, make sure the extension is .xls and not .xlsx. In this case, the First workSheet will be selected by default and the values in the first two columns starting from cell "A2" will be assigned to the Properties Data1 and Data2. For example if there are 5 rows with values in the excel, the test step "Test Request" will be executed 5 times. The values in Data1 and Data2 can be accessed anywhere within the scope of the loop.



6 comments:
  • satyajit says:
    March 05, 2012

    I am not able to get this option for data source. Is it available only in PRO version.

  • Sudeesh says:
    March 06, 2012

    Hello Satyajit..
    Thank you for visiting my site. Yes this option is available only on Pro version. But you can achieve this by using Groovy Script in free version (its a bit tough task though..).

  • Anonymous says:
    April 16, 2012

    Hi Sudeesh,

    If possible can you please share the groovy script to achieve the 'DataSource test step'?


    Thanks and Regards,
    Sandeep

  • Sudeesh says:
    April 17, 2012

    Hi Sandeep..

    I will try to post that soon..A bit busy with work these days.

    Sudeesh

  • Sudeesh says:
    April 27, 2012

    Sorry for the delay Sandeep. Today only I got some breathing time to look into this. Hopefully I will be able to make a post on this soon.

  • Unknown says:
    June 13, 2013

    i tried this one it looks like while looping it is skipping all odd values for eg: i have 5 rows in my excel sheet, in this case it is looping only for 2, 4 rows at 5th row the loop is stopping (would you let me for this do i need to setup anything)

    Note: i noticed at data source section values are repeating
    thanks
    Anusha

Post a Comment

This is a new website mainly for SOA Testers using soapUI. Let me know your thoughts/ suggestions.