Thursday, September 19, 2019

Specflow - specflow outline, excel data,file genrator


  • Specflow single file generator
using the MSBuild integration to generate your code behind file
To use the MSBuild integration, you need to disable this legacy support in the options in Visual Studio. To do so:

Select Tools | Options from the menu in Visual Studio.
Browse to SpecFlow | General in the list on the left (you can use the search field to restrict the options).
Set Enable SpecFlowSingleFileGenerator CustomTool to false under Legacy.
Click OK.
You also need to ensure that SpecFlowSingleFileGenerator is not entered in the Custom Tool field of your feature files.
  • Scenario Outine, the same test with different data


Scenario Outline: Register with valid details
    Given I am on the registration page
        And I have completed the form with <email> <organisation> <password> and <passwordConfirmation>
    When I have clicked on the register button
    Then I will be logged in as <username>
        And my account will be assigned the role of <role>

        Examples: 
        | email     | organisation | password  | passwordConfirmation | username  | role  |
        | usernamea | Bytes        | password1 | password1            | usernamea | Admin |
        | usernameb | Bytes        | password2 | password2            | usernameb | Admin |
        | usernamec | Bytes        | password3 | password3            | usernamec | Admin |
        | usernamed | Bytes        | password4 | password4            | usernamed | Admin |
        | usernamee | Bytes        | password5 | password5            | usernamee | Admin |

Scenario outlines can be used to define data-driven acceptance tests.

  • Excel data
@source:xxx.xlsx:sheet1
 Examples:
        | email     | organisation | password  | passwordConfirmation | username  | role  |
        | usernamea | Bytes        | password1 | password1            | usernamea | Admin |
        | usernameb | Bytes        | password2 | password2            | usernameb | Admin |
        | usernamec | Bytes        | password3 | password3            | usernamec | Admin |
        | usernamed | Bytes        | password4 | password4            | usernamed | Admin |
        | usernamee | Bytes        | password5 | password5            | usernamee | Admin |


No comments:

Post a Comment

API interview questions

  https://www.katalon.com/resources-center/blog/web-api-testing-interview-questions/ Top 50+ Web API Testing Interview Questions [Ultimate l...