I'm very new to BDD testing, and would like to ask, is it possible/OK to test ASP MVC3 actions directly (using WebClient) using SpecFlow?


Feature: Login

Scenario: Logging in
    Given I post form to http://someurl/account/logon with parameters username='test' and password='123'
    Then I expect it to be redirected to the http://someurl/home

1 Answer 1


You certainly can. Both WebClient, or HttpRequest would work well as the 'glue' for this scenario.

Note that I'd probably rephrase your Given/When/Then Statement as something like:

Given the logon page at http://someurl/account/logon 
When I post with parameters username='test' and password='123'
Then I am redirected to http://someurl/home

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.