locked
BDD SpecFlow Scenarios RRS feed

  • Question

  • Hello!
    
    Today I started studying BDD using SpecFlow + Selenium and I found several examples that only showing 1 return.
    
    How do I write a  scenario that returns more than one item. For example:
    
    
    Given a name "test"
    I click on the SEARCH button
    
    
    Then the result will be equal to the table below:
    
    name | last name
    test | fulano
    test | siclano
    
    
    In this case,  How do I write the THEN?, accepting return the 2 rows of the table showed?


    • Edited by Naiade.lima Thursday, September 15, 2016 6:14 PM
    Thursday, September 15, 2016 6:12 PM

Answers

  • Hi Naiade.lima,

    “Then” means this step we should to verify the results that we performed in “when”. I think you should use the following code to verify the results:

    Assert.AreEqual("your expected contents", “results after searching in the web”);

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    • Proposed as answer by Oscar_Wu Monday, September 19, 2016 10:00 AM
    • Marked as answer by Oscar_Wu Monday, October 10, 2016 2:12 AM
    Friday, September 16, 2016 8:41 AM

All replies

  • Hi Naiade.lima,

    “Then” means this step we should to verify the results that we performed in “when”. I think you should use the following code to verify the results:

    Assert.AreEqual("your expected contents", “results after searching in the web”);

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    • Proposed as answer by Oscar_Wu Monday, September 19, 2016 10:00 AM
    • Marked as answer by Oscar_Wu Monday, October 10, 2016 2:12 AM
    Friday, September 16, 2016 8:41 AM
  • Hi Naiade.lima,

    Please feel free to let me know your latest results. Have a nice day :).

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Tuesday, September 20, 2016 8:06 AM