Skip to content

Commit c23dd11

Browse files
authored
fix(webdriverio): fall back to WebDriver Classic #9244 (#9373)
1 parent 96a2965 commit c23dd11

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/browser-webdriverio/src/webdriverio.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,19 @@ export class WebdriverBrowserProvider implements BrowserProvider {
117117
if (this.topLevelContext == null || !this.browser) {
118118
throw new Error(`The browser has no open pages.`)
119119
}
120-
await this.browser.send({
121-
method: 'browsingContext.setViewport',
122-
params: {
123-
context: this.topLevelContext,
124-
devicePixelRatio: 1,
125-
viewport: options,
126-
},
127-
})
120+
if (this.browser.isBidi) {
121+
await this.browser.send({
122+
method: 'browsingContext.setViewport',
123+
params: {
124+
context: this.topLevelContext,
125+
devicePixelRatio: 1,
126+
viewport: options,
127+
},
128+
})
129+
}
130+
else {
131+
await this.browser.setWindowSize(options.width, options.height)
132+
}
128133
}
129134

130135
getCommandsContext(): {

0 commit comments

Comments
 (0)