feat: generate selector for attributes

This commit is contained in:
karishmas6
2024-06-06 05:08:57 +05:30
parent f5af410064
commit 71cd95a1a2

View File

@@ -646,7 +646,21 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
return (name: string) => attrSet.has(name);
}
function genSelectorForAttributes(element: HTMLElement, attributes: string[]) {
let selector = null;
try {
selector = isAttributesDefined(element, attributes)
? finder(element, {
idName: () => false,
attr: genValidAttributeFilter(element, attributes),
})
: null;
} catch (e) {}
return selector;
}
};