Anti forgery token and web testing

后端 未结 3 760
渐次进展
渐次进展 2021-02-09 18:16

I am trying to do a web test in VS2012 for an MVC site. One of the scenarios is to login and go through a list of products, select the one you want and follow through to the pu

3条回答
  •  萌比男神i
    2021-02-09 18:40

    I am not familiar with "web testing in VS2012" but as I know "Anti-Forgery Token" requires sending the token from browser to the server back.

    I had an experience with Selenium-Webdriver and suggest you use it because it provides an API to interact with supported browsers as real user does.

    You can easily start using Selenium WebDriver if you add Selenium WebDriver 2.37.0 NuGet package to you test project.

    Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. How these direct calls are made, and the features they support depends on the browser you are using.

    Selenium-webdriver currently supports the following drivers:

    • Chrome
    • Internet Explorer
    • Firefox
    • Opera
    • HtmlUnit
    • Android

提交回复
热议问题