MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / selectNodes

Function selectNodes

javascript/atoms/locators/xpath.js:223–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221bot.locators.xpath.many = function (target, root) {
222
223 function selectNodes() {
224 var result = bot.locators.xpath.evaluate_(root, target,
225 bot.locators.XPathResult_.ORDERED_NODE_SNAPSHOT_TYPE);
226 if (result) {
227 var count = result.snapshotLength;
228 var results = [];
229 for (var i = 0; i < count; ++i) {
230 results.push(result.snapshotItem(i));
231 }
232 return results;
233 } else if (root.selectNodes) {
234 var doc = goog.dom.getOwnerDocument(root);
235 if (doc.setProperty) {
236 doc.setProperty('SelectionLanguage', 'XPath');
237 }
238 return root.selectNodes(target);
239 }
240 return [];
241 }
242
243 var nodes = selectNodes();
244 goog.array.forEach(nodes, function (n) {

Callers 1

xpath.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected