I have a feature file A.feature which generates a number in the response body. Now, I have to capture that text/number and then pass it as test data to another feature file.Do we need to write step definition or is there any other way?Please suggest.
Asked
Active
Viewed 933 times
0
-
I'm with @szabo in that your scenarios should be independent. – Dave McNulla Jun 17 '16 at 21:09
-
Dependencies between scenarios is a really bad idea. If you sant to seed a scenario, then do it explicit. Do not do it implicit by chaining two scenarios. – Thomas Sundberg Jun 18 '16 at 20:11
1 Answers
3
Generally, you should not do that. In fact you should try to make your test cases totally independent from each other. It's a bad sign if a single code change breaks many of your tests (in your case, whenever the first feature breaks, the second one would as well.) It's also a bad sign that, as a starting point, your second feature needs a special response that is not easy to construct.

Szabo Peter
- 506
- 3
- 7