Is there a headless browser for .NET (for automated Web-UI-Tests)?

前端 未结 4 614
一向
一向 2020-12-10 06:02

Is there a headless browser for .NET?

I am looking for this in a testing context.

Coming from Java I am thinking of something similar to HtmlUnit (http://htm

4条回答
  •  鱼传尺愫
    2020-12-10 06:54

    If you're adamant about sticking with pure .Net solutions, then you have a few useful options, although none of them are really great.

    • HtmlUnit with IKVM. This will let you run HtmlUnit in .NET, but I've found that the converted code tends to be much slower than HtmlUnit all by itself.
    • Data Extraction SDK. You could wrap this to roll your own request processor, and it'll handle cookies, forms, et cetera.
    • System.Net.WebRequest. Requires the most heavy lifting, but underpins most of what you'd be working with anyway.

    You can also consider looking at LiquidTest, but it's not cheap: developer licenses start at $2,000. And if you want to run it on a continuous integration server, that'll cost you another $1,000 for a server license.

    IMO, while the libraries and languages in .NET provide some powerful features, the supporting toolset often falls short of competitors in other languages in some areas. Unfortunately, web integration testing is one of those areas.

提交回复
热议问题