Open lucjanl opened 8 years ago
After submitting this issue I saw it was my mistake: I used slash ((/d+)
) in the second step regex instead of backslash ((\d+)
). But ultimately the message "Multiple matching bindings" is misleading...
This is unrelated to this issue, but reading this issue reminded me a video I recorded many years ago.... "SpecFlow Anti-Pattern: Using Private Members to Retain State Between Steps " https://www.youtube.com/watch?v=IGvxMPX55vE
I agree with the anti pattern assertion, but buyer beware, in the new parallel test world you don't want to be using ScenarioContext.Current
but you should be requesting a ScenarioContext
instance (or some other specific context class you've written) through the step class constructor
@samholder That is correct... I'm going to have to record a new video!!!! :)
@lucenty this is caused by the visual studio integration component reads the code in a different way from the runtime component of SpecFlow. As of now, this is difficult to solve in a general way. You might want to look at the visual studio extension code and see if there is a simple fix to solve this particular issue.
An alternate approach would be that if the integration component detects multiple matches, it could show a list similar to the one shown when a step definition is used in multiple scenarios.
The issue is still open and occured for me too.
Hey guys, Specflow is binding two different sentences to the same method -
Test scenario -
Method name -
Also, "as draft" is highlighted as a parameter, although it is not.
Do you know where I'm making mistake?
The problem is your Regex. (.*)
catches nearly everything.
In you case it could help, if you add '
(single quotes) around your parameters.
That solved my problem. Thanks for help and fast answer!
I use SpecFlow 2.0 and SpecFlow for VisualStudio 2015 version 2015.1.2. I wrote a feature:
and steps definition ServiceSelectionTypeChoosingSteps.cs:
Then I wrote another feature:
and step definition:
Now in the first feature the line
And hotel day starts at 14:00 and ends at 12:00
is black. In the second feature the lineGiven hotel day starts at 14:00 and ends at 12:00
is pink and when I select it and press F12, the SpecFlow addon tells me:I suppose the feature scoping doesn't work. Am I right or I did something wrong?