TestProject Forum
Powered by leading experts in the test automation community

Application / Element Locator strategies

I was excited to see that TestProject allows adding Custom Attribute’s and also allows you to customize what how element locators are prioritized when using the recorder (and I suppose by the AI/ML self healing) for the application being tested.

I have not found much updated documentation regarding this new feature (am sure something is in the works there?). Part of the reason this was so exciting is because in some ways resembles how TestCafé Studio has approached this same issue - the documentation they provided to explain how to leverage this feature was very helpful.

In the mean time, as I create tests and learn how to tweak TP, I am trying to glean and information that helps in getting the recorder to identify and prioritize element locators that work well with our application (a single-page application with dynamic knockout.js components).

A few questions:

Custom Attributes - what is permissible? I have added some custom attributes, and see they get prioritized, but there seems to be some validation as to what is allowed here.

Combined Attributes / Attributes Properties - Since we use knockout.js, there are many data-bind attributes and properties that could be great locators for us. Is there any way to make use of these here? I added the data-bind attribute, but have not found any ways to use them here.

Element Types - TP also allows for the definition of Element Types (under Addons). Can these be leveraged in any way when setting up Application Strategies?

Strategy per Application URL: Is there any way to copy a strategy from one application to another? We have several environments Dev/Staging/QA/Prod, all having different URL’s for access - if the strategies implemented impact how self-healing works, it is important that we keep the settings for these environments in sync in some manner.

Hello @nathan1,

Glad to hear that the new feature is useful for you. We are constantly working towards improving the platform and provide the best solution possible. Your feedback is very much appreciated!

Our solution architects and technical writers are constantly working on expanding and improving the docs, and they will definitely get to this feature documentation soon enough.

Now for the questions:

We do not apply any special validations on custom attributes. They can only contain letters, dashes, and colons. If an element on the final DOM has one of the defined attributes, it will be used as defined on the specific application.

TestProject recorder will not always use all the attributes for defining the element in question. If the generated locator is not unique it will not be generated. Having said that, if you feel that it should work please don’t hesitate to reach over the chat within the platform and one of our solution architects will work with you to troubleshoot the issue.

Nope. Custom element types exist to make it easier to create custom Addons that will target complex elements. Once defining an element type, these elements will be identified in the recorder and the relevant Addon actions will be automatically suggested.

This is a great feature request and we will definitely add this in one of our future versions.

1 Like