appium/appium-inspector

feature request: Store selector values in locator tabs

wazzeps opened this issue · 4 comments

Current Behavior

When switching tabs of locators, the value in the selector input field does not change.

Suggested Solution

Save selector values in each tab separately to make it convenient to compare selectors, for example, by search speed.

Additional Information

No response

Do you mean saving the selector input value separately for each locator type? I can see the convenience, but I'm not sure if this would be a good idea.
The main reason is that this would enforce a specific way of using the locator search: in the current implementation, I can first enter my selector, and only then change the locator type. With this change, I would be forced to always change the locator type before entering my selector. I think this would trip up a lot of people (including myself).
The locator type buttons are ultimately just radio buttons, not tabs (in fact, they were actually a dropdown until not too long ago).

However - I do like the idea of having a more convenient way of comparing custom selectors. I think it would be better if this feature uses its own dedicated modal and header button, where you would be able to enter multiple selectors at once (and choose their locator types), then do one search, and get timing results for all your inputs.

I often have to compare two types of locators for complex iOS elements - xpath and classchain. It would be nice to be able to conveniently switch between them instead of pasting from somewhere. If there are suggestions for implementation details, let's discuss.

I would like to propose a different UI for this purpose, reachable from the locator search modal. In it, the user would be able to select the locator type and enter the selector for two locators at once (this could be extended to more than 2 in the future). Then with a single search request, the app would return the results for both searches at once. I think this would be more convenient for your use case rather than needing to switch the locator type and make a new search request every time.

I am also interested in the results that you are comparing. I assume search timings are the main goal, but do you also need the found elements to be visible? I suppose they could be useful for validating that both searches gave the same results. At the very least, I don't think that it is necessary to include the element actions in this UI.

That's right, search time is the main goal and element actions are not needed.