ff-dom 1.0.18-beta.5 → 1.0.18-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +13 -14
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +13 -14
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cdn.js +13 -14
- package/package.json +1 -1
- package/src/utils/getElementsFromHTML.ts +2 -2
package/dist/index.browser.js
CHANGED
|
@@ -1080,7 +1080,7 @@ const getUniqueParentXpath = (domNode, docmt, node, isTarget, nodeXpath, isIndex
|
|
|
1080
1080
|
currentNode = currentNode.parentElement;
|
|
1081
1081
|
}
|
|
1082
1082
|
// Final constructed XPath
|
|
1083
|
-
const finalXPath = xpathParts.join("");
|
|
1083
|
+
const finalXPath = xpathParts.join("") + nodeXpath;
|
|
1084
1084
|
let count = getCountOfXPath(finalXPath, domNode, docmt);
|
|
1085
1085
|
if (count === 1) {
|
|
1086
1086
|
parentXpathCache.set(domNode, finalXPath); // Cache final result
|
|
@@ -2275,7 +2275,7 @@ const getElementsFromHTML = (record, docmt) => {
|
|
|
2275
2275
|
tag.remove();
|
|
2276
2276
|
});
|
|
2277
2277
|
}
|
|
2278
|
-
tempDiv.innerHTML = document.body
|
|
2278
|
+
tempDiv.innerHTML = document.body?.innerHTML;
|
|
2279
2279
|
const finalLocatorsSet = new Set();
|
|
2280
2280
|
let finalLocators = [];
|
|
2281
2281
|
function createLocator(base, overrides = {}) {
|
|
@@ -2378,7 +2378,7 @@ const getElementsFromHTML = (record, docmt) => {
|
|
|
2378
2378
|
else if ((locator.name.includes("xpath") ||
|
|
2379
2379
|
trimmedSelector.startsWith("//")) &&
|
|
2380
2380
|
!locator.type.match("dynamic")) {
|
|
2381
|
-
if (tempDiv
|
|
2381
|
+
if (tempDiv?.innerHTML) {
|
|
2382
2382
|
const normalizedXPath = normalizeXPath(trimmedSelector);
|
|
2383
2383
|
targetElement = getElementFromXPath(tempDiv, normalizedXPath);
|
|
2384
2384
|
if (targetElement) {
|
|
@@ -2475,17 +2475,16 @@ const getElementsFromHTML = (record, docmt) => {
|
|
|
2475
2475
|
});
|
|
2476
2476
|
});
|
|
2477
2477
|
}
|
|
2478
|
-
const
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
:
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
: "Y",
|
|
2478
|
+
const xpathResults = parseDOM(targetElement, document, false, true);
|
|
2479
|
+
xpathResults.forEach((result) => {
|
|
2480
|
+
const fnValue = result.value;
|
|
2481
|
+
record.locators.forEach((loc) => {
|
|
2482
|
+
createLocator(loc, {
|
|
2483
|
+
name: 'xpath',
|
|
2484
|
+
value: fnValue,
|
|
2485
|
+
isRecorded: loc.value === fnValue ? loc.isRecorded : 'Y',
|
|
2486
|
+
isSelfHealed: loc.value === fnValue ? loc.isSelfHealed : 'Y',
|
|
2487
|
+
});
|
|
2489
2488
|
});
|
|
2490
2489
|
});
|
|
2491
2490
|
for (const locator of record.locators) {
|