Skip to content

Commit c129dc9

Browse files
authored
[js] Fix flaky CDP dom mutation (#10029)
1 parent d6acda7 commit c129dc9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,4 +429,5 @@ module.exports = {
429429
withTagName: withTagName,
430430
locateWith: locateWith,
431431
checkedLocator: check,
432+
escapeCss: escapeCss
432433
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ class WebDriver {
14721472
if (params.method === 'Runtime.bindingCalled') {
14731473
let payload = JSON.parse(params['params']['payload'])
14741474
let elements = await this.findElements({
1475-
css: '*[data-__webdriver_id=' + payload['target'],
1475+
css: '*[data-__webdriver_id=' + by.escapeCss(payload['target']) + ']',
14761476
})
14771477

14781478
if (elements.length === 0) {

0 commit comments

Comments
 (0)