Skip to content

Commit e14ef4e

Browse files
DavertMikclaude
andcommitted
fix: use browser.keys for WebDriver typeText/selectAll
webdriverio keys() lives on browser, not element. Route typeText and selectAllAndDelete through helper.browser.keys() for the WebDriver path so rich-text scenarios (hidden-textarea + iframe editors) work. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent fe5ce3e commit e14ef4e

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/element/WebElement.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class WebElement {
307307
case 'puppeteer':
308308
return this.helper.page.keyboard.type(s, options)
309309
case 'webdriver':
310-
return this.element.keys(s.split(''))
310+
return this.helper.browser.keys(s)
311311
default:
312312
throw new Error(`Unsupported helper type: ${this.helperType}`)
313313
}
@@ -335,11 +335,13 @@ class WebElement {
335335
}
336336
await this.helper.page.keyboard.press('Backspace')
337337
return
338-
case 'webdriver':
339-
await this.element.keys(['Control', 'a'])
340-
await this.element.keys(['Meta', 'a'])
341-
await this.element.keys(['Backspace'])
338+
case 'webdriver': {
339+
const b = this.helper.browser
340+
await b.keys(['Control', 'a']).catch(() => {})
341+
await b.keys(['Meta', 'a']).catch(() => {})
342+
await b.keys(['Backspace'])
342343
return
344+
}
343345
default:
344346
throw new Error(`Unsupported helper type: ${this.helperType}`)
345347
}

0 commit comments

Comments
 (0)