New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve xpath locator suggestions #1131
Conversation
jlipps
commented
Oct 16, 2023
- Add some attributes that we should consider for uniqueness
- Add search for attributes that might be unique as pairs
- Show a few more attributes by default in the XML source
I've run into this case a few times and feel this is an improvement to our suggested XPath locators. |
7e83628
to
f46b60d
Compare
f46b60d
to
b0c7f57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to modify package.lock in this PR?
- Add some attributes that we should consider for uniqueness - Add search for attributes that might be unique as pairs - Show a few more attributes by default in the XML source
b0c7f57
to
baeddd0
Compare
I suppose we don't! removed |
'label', | ||
'value', | ||
'id', | ||
'class', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think class
should be always shown in the XML view. On Android (which I would expect is the most common use-case for the inspector) this just adds a duplicate of the element type, needlessly bloating every single element item.
At the same time, it would be great if it was shown in webview mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah good point. I added it thinking of webviews. We probably need to refactor this code so that all of these arrays are sensitive to which platform we're dealing with.
And this could be part of a bigger project that lets drivers declare facts about themselves to the inspector so that we don't have to hardcode these things in the inspector itself.
I've got another open PR, I'll remove class from that one so at least we keep the status quo for now.
- Add some attributes that we should consider for uniqueness - Add search for attributes that might be unique as pairs - Show a few more attributes by default in the XML source