feat: prioritize returning iframe selector if exists

This commit is contained in:
RohitR311
2025-01-04 09:14:05 +05:30
parent 9eb4ec398a
commit 2943681c9b

View File

@@ -12,6 +12,11 @@ export const getBestSelectorForAction = (action: Action) => {
case ActionType.Hover: case ActionType.Hover:
case ActionType.DragAndDrop: { case ActionType.DragAndDrop: {
const selectors = action.selectors; const selectors = action.selectors;
if (selectors?.iframeSelector?.full) {
return selectors.iframeSelector.full;
}
// less than 25 characters, and element only has text inside // less than 25 characters, and element only has text inside
const textSelector = const textSelector =
selectors?.text?.length != null && selectors?.text?.length != null &&