I have a scenario outline, and in the examples table there are around 14 different fields.
I have two tables that have similar data. At the moment I have two methods that can parse this data but there is a lot of duplication of code.
Is there a way of using specflow scenario outline/example and sending back a list of all the objects, so I don’t have to have item1 and item2…and item14?
I understand many user journeys need a lot of data for their completion. When we quote insurance, there is driver data, vehicle data, and other data required for the quote. However, we can break up the quote into many smaller transactions and evaluate them in isolation. I was wondering if that is possible.
That is, the user needs 14 pieces of data for the journey. Do they need all 14 for all parts of the journey? Is it possible that three are needed to start, three more in the middle, and so forth?
What I have done with SpecFlow is to use the Given statement code skeleton to set up the test. In this case, you would call your code that populates your object with the shared fields. If there is other set up required, I’ve executed that set up as well.
The When statement executes the action. If I assume your page is a web page, then this action is a navigation or a submit.
After the action is executed, what happens next? Navigation to another page? Collect data from another page?
I’ve been re-reading our conversation. I’m not sure I’m helping and it is challenging to explore testing challenges in this context.
Your testing challenge is an interesting one but I’m not sure I’m fully appreciating its scope. When we started, you were looking for suggestions to easily group data and you were using SpecFlow. Also, you mention having to present the data multiple times to the application. Your last comments give me the impression that you want to have some method to store the data and move it easily into an object.
I have a suggestion for the data-to-object challenge but wanted to ask first if it is possible to provide screen shots of the application, and, perhaps, some idea of the testing objective.
You mentioned a CSV file for storing your data. A CSV could be used but the parsing could be a distraction. One method I have used to stored a large amount of data is to use a JSON format. In C#, you can define a class that represents your data. Using NewtonSoft, you can serialize and deserialize the class quickly. Thoughts?
I can’t really show screen shots of the application - we haven’t signed a contract yet, so it’s all a bit hush hush.
Basically it’s a loan application. One page has a bunch of fields - loan amounts. term. type etc.
I have a feature file which has around 9 scenarios in the examples table. So the test loops 9 times. and on the one page, it inserts up to 14 fields, depending on the criteria supplied (some fields are hidden depending on the selection)