emulate
WebdriverIO allows you to emulate Web APIs using the emulate
command. These Web APIs can then
behave exactly as you specify it.
Read more on this in the Emulation guidelines.
اطلاعات
It is not possible to change the emulated value without reloading the page.
اطلاعات
This feature requires WebDriver Bidi support for the browser. While recent versions of Chrome, Edge and Firefox have such support, Safari does not. For updates follow wpt.fyi. Furthermore if you use a cloud vendor for spawning browsers, make sure your vendor also supports WebDriver Bidi.
Usage
browser.emulate(scope, options)
Parameters
Name | Type | Details |
---|---|---|
scope | string | feature of the browser you like to emulate, can be either geolocation , userAgent , colorScheme or onLine |
options | EmulationOptions | emulation option for specific scope |
Examples
example.js
loading...
example.js
loading...