When I provide examples in a single row it works fine. When I provide examples in more than a row I'm getting binding parameter exception. If I provide all examples in a single line its not readable easily.
Feature: ConversionUnencrypted Pdf-Pdf
@mytag
Scenario Outline: ConversionUnencrypted Pdf-Pdf
Given I get Inputs Folder and list of Files <inputFolder> then <getInputTokens>
Given I get '<outputDirectory>'
Given I get directory to save Images '<ImagesOutputDirectory>'
Examples:
| inputFolder | getInputTokens | outputDirectory | ImagesOutputDirectory |
| D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Inputs\2files | Input1.pdf,Input2.pdf | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\AfterConvertingToPdf\2files | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Actual\2files |
Given I set saving Mode <ConversionMode>
Given I convert pdf using Conversion
Given I convert to Image '<convertToFile>'
Then I compare Images '<getActualImagePath>' and '<getExpectedImagePath>' and '<pageCount>'
| ConversionMode | convertToFile | getActualImagePath | getExpectedImagePath | pageCount |
| ConvertToSingleFile | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\AfterConvertingToPdf\2files | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Actual\2files | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Expected\2files | 82 |
Works fine if Examples look like this :
Examples:
| inputFolder | getInputTokens | outputDirectory | ImagesOutputDirectory | ConversionMode | convertToFile | getActualImagePath | getExpectedImagePath | pageCount |
| D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Inputs\2files | Input1.pdf,Input2.pdf | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\AfterConvertingToPdf\2files\ | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Actual\2files\| ConvertToSingleFile | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\AfterConvertingToPdf\2files\ | D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Actual\2files |D:\SVN_Projects\XDoc.Net\SpecFlow\Conversion\ConvertToPdf\Expected\2files | 82 |
There are a couple of things wrong with your first scenario. You have mixed you steps with your examples. The steps must be in the scenario outline, they can't be in the examples.
Given that, if you re-wrote your scenario with the steps in the outline then it would look like this:
now it becomes more obvious why you can't have two sets of examples on different lines, because it looks like the
inputFolder
has a value ofConversionMode
, when actuallyConversionMode
is a title.you main problem here is that you have full file paths in your examples. This is an implementation detail and it would be better, IMHO, to remove these paths and to use monikers instead. After all those full file paths are not going to work on anyone elses machine that yours and not on the build server. I would consider rewriting them like this:
Although even this has a lot of duplicate information now it has been reduced and so your entire scenario could be re-written like this
and then you base folders can either be made relative to you project and deployed as part of the tests build or can be held in configuration.