-1

I have a cucumber scenario in which I have to pass the data, and the data contains special characters. And when I execute it fails at the assertion.

Below is my scenario:

Scenario Outline: ABTA data  
Given a customer is on the "<respective>" page  
When the customer scrolls down to the bottom of the page  
Then the customer should be able to view the following text with ABTA logo  
|We're part of XXX Group - one of the world's leading| 

Example:
|Home Page|

The data which I am passing after the Then step "We're part of XXX Group - one of the world's leading" has 2 special characters and because of that my assertion fails.

Can anyone please let me know as of how can I ignore the special characters in the data

Royg
  • 1,665
  • 1
  • 13
  • 20
shashank sinha
  • 61
  • 2
  • 12

2 Answers2

-1

I think you need to better define your code

Scenario Outline: ABTA data
  Given a customer is on the <respective>
  When the customer scrolls down to the bottom of the page
  Then the customer should be able to view the following text with ABTA logo
<expected>

  Examples:
    | respective | expected                                             |
    | Home Page  | We're part of XXX Group - one of the world's leading |

And the cucumber step should be defined as

@Given("^a customer is on the (.*)$") {...}   

@Then("^the customer should be able to view the following text with ABTA logo (.*)$") {...}
Royg
  • 1,665
  • 1
  • 13
  • 20
-1

Your syntax is wrong. If you check the documentation you will see that the proper way is different. It's the official documentation from Cucumber.

There is also one more issue like yours. Please check this too: Escape characters in Cucumber step definition

dpapadopoulos
  • 1,834
  • 5
  • 23
  • 34