Skip to content

Commit 17be44b

Browse files
author
David Haeffner
committed
Re-added the xpath:innerText locator strategy, without the check against preciseXPath
1 parent 82856db commit 17be44b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

packages/selenium-ide/src/content/locatorBuilders.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,10 @@ LocatorBuilders.add('xpath:position', function(e, opt_contextNode) {
490490
return null
491491
})
492492

493-
//LocatorBuilders.add('xpath:innerText', function(el) {
494-
// if (el.innerText && el.nodeName !== 'DIV') {
495-
// const initialXpath = `//${el.nodeName.toLowerCase()}[contains(.,'${
496-
// el.innerText
497-
// }')]`
498-
// return this.preciseXPath(initialXpath, el)
499-
// } else {
500-
// return null
501-
// }
502-
//})
493+
LocatorBuilders.add('xpath:innerText', function(el) {
494+
if (el.innerText) {
495+
return `xpath=//${el.nodeName.toLowerCase()}[contains(.,'${el.innerText}')]`
496+
} else {
497+
return null
498+
}
499+
})

0 commit comments

Comments
 (0)