Appium-desktop: Custom XPath validator on Appium-desktop as we had previously

Created on 30 Mar 2017  路  11Comments  路  Source: appium/appium-desktop

In old Appium UI, under Object Spy we had a utility which validated custom XPATH. It will be a good feature for the Appium desktop object spy as well.

We can add a Custom XPATH validator or we can add option to select selector type and provide value to validate against current screen.

enhancement

Most helpful comment

Yeah, we've talked about something like that before. My idea was a search modal where you select a locator strategy (xpath, name, id, etc...) and then input a locator and it lists the elements that meet that criteria.

All 11 comments

Yeah, we've talked about something like that before. My idea was a search modal where you select a locator strategy (xpath, name, id, etc...) and then input a locator and it lists the elements that meet that criteria.

Xpath is quite useful because we have many elements in our app that are not tagged or exactly assessable.

馃憤 for this missing fundamental missing feature

Hey @mvanini @reuningATL @Prasant-Sutaria

We added a new feature that calculates an XPath for an element (see https://github.com/appium/appium-desktop/commit/413018388d9b7d489c7211d1ffe4a8867aedfe25) and it does heuristics to determine the "optimal" xpath.

Is this sufficient or do you think we should add another feature which allows the user to actually test xpaths?

I personally think the feature that heuristically optimizes the automatically generated xpath is a great idea, but in my opinion it does not remove the need for the capability to test custom xpaths.
For example sometimes I find the need for to do things like 'following-sibling::' in the xpath to keep it short and meaningful.

same as @vanangelov for me: sometimes I use "complex" xpath, it would be usefull to test into the inspector instead running (long) appium-test.

I know this is a closed issue, but the following the references all the linked tickets are closed too. Please consider re-opening it.

The ability to check a custom Xpath is not a nice to have part of a test automation framework, it is essential. Otherwise you fall back on dumb, time consuming trial and error. There was a feature in the previous version of appium-desktop which enabled validation of custom Xpaths, which was awesome - I believe it is an essential feature of the new one too. As a user, I commonly extract xpaths from the app, but just as often (during maintenance / triage of scripts) validate my coded xpaths against the app.

@dpgraham @jlipps
btw - great work on the new version of a-d, script recording in windows ftw! just add xpath checking and we're onto a winner

We closed this since the feature has been implemented. It just hasn't been released yet. If you build from master you will see the element finding feature which can be used to find elements via xpath.

Great stuff, so I've reviewed the find feature in the latest build, I guess what I'm looking at is a feature request then.
Listing the elements and being able to tap, clear, sendkeys is great - how about highlighting the matches in the screenshot and application XML?
This would mean that you can see what your xpath refers to, and would a massive productivity enhancement for those of us maintaining appium-based suites.
Are you considering enhancements at this stage?

@3dmundbarton Thanks for reviewing it, I appreciate the positive feedback!

One of the limitations we deal with is that when you search for elements using Appium it returns a list of element ID's but doesn't give any information other than that so we can't actually link the elements returned in the search results with the XML node in the source tree.

What I could possibly do is make it so that when you select an element in the list, it fetches that element's bounds and then highlights it in the screenshot (although I don't think we could highlight the source XML node for the reason stated in the above paragraph). I agree it would be helpful to actually know which element you're clicking on.

Was this page helpful?
0 / 5 - 0 ratings