I am implementing Specflow as suggested here
The challenge for me currently is - My single Tests execution combines multiple features. So I noticed when we have a a chained step definitions flow - Some of Step definitions throw Step Binding error-
Example below-Feature is to select one of the results, based on the selection the page header changes. So I already have written a feature for search which will be re-used within this feature-
Feature File
Given Search a specific account <searchText> to match <column>
When A specific checkbox is selected <searchText>
Then The header should display the id
Scenarios:
| searchText | column |
| "AutoName21944" | "Account Name" |
Step definitions:
[Given(@"Search a specific account ""(.*)"" to match ""(.*)""")]
public void GivenSearchASpecificAccountToMatch(string acctName, string column)
{
Given[PreCondition for Search step]
When("I search for Portfolio " + acctName+" in ") - *Step reused from Search*
Then("the result should display records with " + acctName + " in column " + column)- *Step reused from search feature*
}
When A specific checkbox is selected <searchText>
{
}
When we try running the above feature file - get Error on No Step Binding for Then("@ the result should display records with AutoName(.*) in column Account Name)
Is the reason behind Failure due to using When from Setting Account feature after Then from Search feature?
[Then(@"the result should display records with (.*) for (.*) in column (.*)")]
public void ThenTheResultShouldDisplayRecordsWithAutoInColumnAccountID(string searchTxt,string field,string col)
{
HomePage hm=new HomePage();
}