All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.selenide-core.6.11.2.source-code.find-elements-by-text-case-insensitive.js Maven / Gradle / Ivy

There is a newer version: 7.6.1
Show newest version
(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