问题
I am trying to run a load test on my web application with Testcafe, by concurrently running a single test for each "user" in the system.
I need to run 1000 instances of the test but ran into a resource problem on the test side - running multiple Testcafe instances is very resource heavy and I was wondering if anyone knows a way to run a batch of Testcafe tests concurrently without the performance overhead?
回答1:
As an alternative, you can run TestCafe in an AWS lambda with a headless browser.
Here is what we use for reSolve framework load testing: https://github.com/reimagined/testcafe-serverless
回答2:
If you plan to use Testcase for load testing and don't have enough hardware in order to kick off the required amount of concurrent browser sessions the only solution is going for Cloud browser instance
However a better idea would be simulating the browsers on HTTP protocol level as modern browsers have immense footprint in terms of CPU and RAM and if your target is to load test a website you can just send the same HTTP request as the browser does using a dedicated load testing tool and it will take much less resources.
Check out Open Source Load Testing Tools: Which One Should You Use? article which highlights, describes and compares modern free and open source solutions and frameworks for the performance testing, the vast majority offers record and replay functionality so if you run your Testcafe script using the load testing tool of your choice as the proxy - you will get a "skeleton" of the load testing project in the time it takes to execute your Testcafe test scenarios.
来源:https://stackoverflow.com/questions/61731078/testcafe-concurrent-load-test-performance