.selenide-core.7.4.1.source-code.find-elements-by-text-case-insensitive.js Maven / Gradle / Ivy
(function () {
const root = arguments[0] || document.body;
const text = arguments[1].toLowerCase().replace(/\s+/gi, ' ');
const limit = arguments[2];
const treeWalker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
const nodeList = [];
while (nodeList.length < limit && treeWalker.nextNode()) {
const node = treeWalker.currentNode;
if (node.nodeType === Node.TEXT_NODE && node.textContent.toLowerCase().replace(/\s+/gi, ' ').trim() === text) {
nodeList.push(node.parentNode);
}
}
return nodeList;
})(...arguments)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy