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

378 Views Asked by At

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 |
1

There are 1 best solutions below

0
Rahul On BEST ANSWER

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

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