Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot insert white spaces in string in the examples table

Feature:player
@all

  Scenario Outline:Where is the player

    Given I navigate to Google
    When I enter < player> in the search field
    Then the text < keyword1> should be present

    @current @football
    Examples:
      | player  | keyword1   |
      | Rooney  | Manchester |
      | Gerrard | Liverpool  |
      | Terry   | Chelsea    |
    @old @football
    Examples:
      | player          | keyword1   |
      | Eric Cantona    | Manchester |

If I write Cantona instead of Eric Cantona then it is working, but as soon as you run the program with white space inserted in a string it gives an error.

like image 653
user1304665 Avatar asked Dec 10 '25 23:12

user1304665


1 Answers

Try putting quotes around the Scenario Outline placeholders (and removing the leading space from the placeholder). For example:

Scenario Outline: Where is the player

  Given I navigate to Google
  When I enter "<player>" in the search field
  Then the text "<keyword1>" should be present
like image 171
orde Avatar answered Dec 12 '25 23:12

orde