I have to pass "#" symbol as parameter in feature file. How to achieve that as # symbol represents comments in feature file
Asked
Active
Viewed 592 times
0
-
# is used for comments normally. Did you try escaping the character maybe? – D. Lawrence Dec 11 '19 at 10:46
-
Yes but it did not work – MVLS Dec 11 '19 at 10:57
-
The # is only a comment when used at the start of a line. – M.P. Korstanje Jan 26 '20 at 21:53
1 Answers
1
If you are using cucumber version 4.x.x or above you can use (.*) regular expression in step definition to take any kind of parameters.
Sample Feature File:
Scenario: User searches for a character in Search
When The user searches for # in the Search
Sample Step Definition:
@When("The user searches for (.*) in the Search")

Sooraj
- 565
- 3
- 8