Ask a Question

Data driven- can i feed multiple columns of the spreadsheet into a single field in service call?

dief123
Occasional Contributor

Data driven- can i feed multiple columns of the spreadsheet into a single field in service call?

I have an excel spreadsheet data driven loop in my testcase.  I want to setup multiple columns in the spreadsheet with different data, but I want to be able to loop thru each cell on each row and feed the test that way.  So I want to process Row 1 and put column A into a variable in the service call and have it execute, then loop thru and continue on Row 1, but feed Column B into the variable.  Then, I want it to move to Row 2, and loop thru each cell?

 

Is this possible and if so, how do i set it up?

2 REPLIES 2
Nastya_Khovrina
SmartBear Alumni (Retired)

Hi dief123,

 

The Excel data source obtains data from the Microsoft Excel file. It assigns data from the columns to the properties in the order they are listed in the editor. That is, the value of the first column will be assigned to the first property, the second column - to the second property, and so on. It works with one row per iteration. So, it there are several columns, you cannot go through cells one by one in order to assign the cell value to one property.

 

But, you should be able to achieve your task using a groovy script. Here is the article to start:

Example of using third-party Java libraries in Groovy script: reading from Excel file using Apache P...

 


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
TanyaYatskovska
SmartBear Alumni (Retired)

Thanks for your help, Nastya.

 

@dief123, did this suggestion help you?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: