High non-200 response codes generated by your application server
Learn how to avoid flaky tests due to a high number of non-200 response codes.
Issue
When you run a test using BrowserStack Automate, the following warning might appear on the Issues Detected tab in the Automate dashboard:
More than 10% URLs received non-200
Cause
Typically, non-200 responses are returned by an application server under test when the requested resources are not available. The browsers at the BrowserStack devices communicate with your application server. However, if these browsers are not able to access the resources, then non-200 response codes might be returned by your application server.
Some other causes for this warning are:
- Your application server might be operating under heavy load.
- Your applications server might be fetching resources from some third-party services that might be temporarily unavailable.
Why you must mitigate this issue
As an organization, optimizing your builds to run faster, is crucial. BrowserStack understands the need to identify issues that might not be evident, but have a large impact on the speed and stability of your test sessions.
Use the resolutions provided to mitigate these issues so as to:
- Improve performance
- Reduce test flakiness
Resolution/Workaround
You can try the following options to debug the warning:
- Check the
Network Logs
tab for your session in the Automate dashboard. - Add better exception handling in your test script.
- Add retry logic to fetch resources from your application server in your test script.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!