Cross-platform headless browser automation for ASP.NET 5 UI testing on multiple operating systems

I’m working on an ASP.NET 5 project that targets dnxcore50 and runs perfectly across Windows, Mac, and Linux platforms. The issue I’m facing is with UI testing. I can develop and deploy the application on all three operating systems without problems, but when it comes to automated UI testing, I hit a roadblock. I need a headless browser solution that can handle browser automation similar to what Selenium provides, but it must work consistently across all these platforms. Has anyone found a reliable way to implement cross-platform UI testing for ASP.NET 5 applications? What tools or frameworks would you recommend for this scenario?

Had the exact same UI testing headaches when we moved our ASP.NET Core app to multi-platform. Tried a bunch of different solutions and Puppeteer Sharp ended up being perfect for headless browser testing. It’s basically a .NET wrapper for Chrome DevTools Protocol and automatically handles Chrome/Chromium installs across different OS platforms. Best part? The same test code runs on our Linux build servers and Windows dev machines without any config tweaks. Headless Chrome spins up fast and uses way less resources than Selenium WebDriver. For our ASP.NET 5 setup targeting dnxcore50, we just grabbed it from NuGet and set it up to launch headless browsers during automated test runs.

I encountered a similar challenge a while ago during the transition of our ASP.NET application to .NET Core for a cross-platform environment. After testing several options, I settled on using Playwright, which has proven to be reliable for our CI/CD process across Windows, Mac, and Linux. The tool automatically manages browser binaries and offers solid .NET support, eliminating the need for platform-specific adjustments. Headless mode functions seamlessly in our Docker containers on Linux, and the same test scripts operate on both Windows and Mac without issues. Additionally, Playwright’s features for automatic screenshot and video recording have significantly simplified the debugging process for failed tests in headless mode.

puppeteer sharp’s solid, but i’d also look at selenium with headless chromium. we use it for asp.net core testing across all three platforms without issues. just remember the --no-sandbox flag on linux or you’ll hit permission problems.