Assertion & Verification

  • Assertion are the check points in the test.
  • There are used to validate, whether the expected output and actual output are same or not.
  • Base on the assertion, the test case either get passed or failed.
  • The line at which assertion failed, after that line all the line the code will be skipped.
  • For assertion we are going to use “Assert” class.
Assert Class
Debug step Validate by Assert Class

Type of verify : Using by Assert Class or can implement function for validate

Example to use Assert class
Example to create HelperAssert Class

Argument Passing

There are three ways by which one can pass the argument from feature file to step definition.

  • Parameter : Specifying the parameter direct in step.
Passing Parameter 1
Passing Parameter 2
  • Data Table : Use to pass multiple argument.

|Header1|Header2|Header3|Header4|…

|val1|val2|val3|val4|…

|val1|val2|val3|val4|…

Example table data
Example table data

It’s just a basic simple for using. I hope, everyone will be enjoy with Automate by specflow.

--

--

Piyathida San-aoun
Piyathida San-aoun

Written by Piyathida San-aoun

Software Developer Engineer In Test

No responses yet