-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support emulation of network conditions #776
Comments
If the question is on the implementation side, on Firefox we support Network Throttling in DevTools scoped by tab. So it shouldn't be an issue. |
The Browser Testing and Tools Working Group just discussed The full IRC log of that discussion<AutomatedTester> topic: emulator - Support emulation of network conditions<AutomatedTester> github: https://github.com//issues/776 <dmurph> q+ I have a question about testing / interception new navigables (github issue https://github.com//issues/756), it's on the topic bank - would that be possible to quickly check in about? <dmurph> q+ to ask about github issue: https://github.com//issues/756 <jgraham> q? |
The Browser Testing and Tools Working Group just discussed The full IRC log of that discussion<AutomatedTester> topic: Emulation - Support emulation of network conditions<AutomatedTester> github: https://github.com//issues/776 <jgraham> q+ <AutomatedTester> AutomatedTester: This is something that is regularly coming up to allow people to test their applications and make sure they are useable offline as well as making sure that service workers are installed properly and application is usable in "low" network areas <AutomatedTester> ack jgraham <AutomatedTester> jgraham: There are clear uses and I am in favour of working on this. I wonder if setOffline should be a separate command and isn't related to emulating the network <AutomatedTester> ... and I don't think we should be using magic numbers here <AutomatedTester> ... I also think the spec work here will be very intricate. we can't just use Fetch here <AutomatedTester> q? <sadym> q+ <AutomatedTester> ack sadym <AutomatedTester> sadym: having offline and throughput will be good <AutomatedTester> ... and I am in favour of dropping `-1` as a value |
Currently, network condition emulation applies globally to the browser (if possible at all), but it would be very useful to emulate network disconnection or throttling for specific browsing contexts (such as tabs or windows) independently.
This feature would provide more control over testing scenarios where individual contexts simulate network loss or restricted connectivity, while other contexts remain unaffected.
Use Cases
Simulating Network Outages for Specific Tabs: Being able to emulate a network outage for a single tab or window while keeping other tabs connected. This is useful for testing progressive web apps (PWAs), handling network errors in single-page applications, or multi-tab synchronization.
Multi-Context Testing: Testing how different contexts react to network issues independently. This is especially useful in applications where different parts of the app rely on separate network calls (e.g., one window working while another goes offline).
Offline-First Applications: Testing apps that are designed to work offline in a more realistic scenario where only certain windows/tabs experience network issues, rather than the entire browser being set to offline mode.
Proposal
Introduce an API to WebDriver BiDi that allows specifying custom network conditions (e.g., offline, latency, download/upload throttling) for specific browsing contexts, rather than affecting the entire browser.
The API could look like:
Benefits
Questions
References
The text was updated successfully, but these errors were encountered: