cucumberbddgherkinfeature-file

Cucumber Feature File : How to escape the character | in Examples of Scenario Outline


In the below scenario , "Characters * / : [ \ ] | # % { } ? &space are not allowed in filename" contains | as special character . But it is considered as separator symbol (|) and getting the error " inconsistent cell count within the table". Please let me know how to escape | in the dataset of Examples keyword

@Test
Scenario Outilne:Verify special characters while uploading file
    Given user login
    When user try to upload a file
    Then user verifies error message "<error>" 

Examples:
   | error                  |
   | Characters * / : [ \ ] | # % { } ? &space are not allowed in filename |

Solution

  • It worked by using \ character before | i.e,

    Examples:
       | error                  |
       | Characters * / : [ \ ] \| # % { } ? &space are not allowed in filename |