Skip to content

Commit 8bc731c

Browse files
committed
[js] ignore errors arising from trying to use file detector fixes #6343
1 parent 466621d commit 8bc731c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

javascript/node/selenium-webdriver/lib/webdriver.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,10 +2538,15 @@ class WebElement {
25382538
)
25392539
}
25402540

2541-
keys = await this.driver_.fileDetector_.handleFile(
2542-
this.driver_,
2543-
keys.join('')
2544-
)
2541+
try {
2542+
keys = await this.driver_.fileDetector_.handleFile(
2543+
this.driver_,
2544+
keys.join('')
2545+
)
2546+
} catch (ex) {
2547+
console.log('Error trying parse string as a file with file detector; sending keys instead' + ex)
2548+
}
2549+
25452550
return this.execute_(
25462551
new command.Command(command.Name.SEND_KEYS_TO_ELEMENT)
25472552
.setParameter('text', keys)

0 commit comments

Comments
 (0)