A flaky binding error - index out of range
Hello,
We are using SpecFlow to run some integration tests and came across a flaky problem in one of the tests:
TechTalk.SpecFlow.BindingException: Error calling binding method 'XXX:WhenYYY()': Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) in D:\a\1\s\TechTalk.SpecFlow\Bindings\BindingInvoker.cs:line 66
...
It doesn't always happen (hance the flaky), but we would like to see if we can understand the origin of this problem.
Does anyone know or came across this problem?
Thanks,
Moshe
-
Without a concrete example of the step, the binding regex, and a full call stack I can't really say anything what is happening here.
0 -
I just had this exact error and it's misleading. In our case at least, one of the method parameters (supplied by an Examples table) was used as an index into an array inside the step which was failing because the element didn't exist.
I'm not sure why this shows up as a binding error as by this point the parameters are already successfully assigned. It should've just been a simple array out of bounds exception.Hopefully this helps the next person.
0
Please sign in to leave a comment.
Comments
2 comments