Closed ASaiAnudeep closed 3 weeks ago
@ASaiAnudeep thanks for raising the issue. We will soon deprecate this service as WebdriverIO supports its own network mocking capabilities in which you can implement the given code as following:
const mocks = await Promise.all([
browser.mock('.*google-analytics.*'),
browser.mock('.*facebook.*')
])
mocks.forEach((mock) => mock.abort())
We recommend update to latest WebdriverIO and give this a try.
Thanks a lot for the quick response @christian-bromann , I will give it a try.
I wanted to mention that using browser.mock
is not feasible for us because it isn't supported on BrowserStack or SauceLabs, which are critical to our testing infrastructure. This limitation is a hard blocker for our testing setup.
Is there any alternative approach or workaround that you could suggest for handling it.
Thanks in advance.
@ASaiAnudeep in v9 the mock
command uses WebDriver Bidi primitives which should work on Sauce Labs and BrowserStack. I will update the docs to reflect that.
I am encountering an issue where unwanted logs appear in the console while intercepting network requests. Specifically, I am seeing repeated log entries like the following:
I have tried to exclude these URLs from interception by using the
excludeUrls
method, but the logs still persist. Here is the code snippet I used for exclusion:If there is a known issue or workaround, please let me know.