Hello,
I noticed that in Angular 2 the recording of elements is not ideal. Always something like tagindex:23 etc.
I know that you can add in the "Find Logic (Html)" element names but it seems that the Angular 2 elements are still not located and used to determine the best element selection.
I added the following elements:
- formcontrolname
- formarrayname
Is there anything I can do to improve it or make it work?
Thanks,
Bjorn
5 Answers, 1 is accepted
Thank you for this question.
How the find logic would be automatically generated depends on:
- priority set in the project settings -> Find Logic (Html) - the top of the list has the highest priority
- elements in the application and their attributes
If you observed different behavior, please provide a repro in order to investigate the case.
Regards,
Nikolay Petrov
Telerik by Progress
Unfortunately the page is not public available yet so I have to do it with screenshots.
As you can see in the html.jpg there is an unique element "formControlName"
But in the telerik-element.jpg you can see that telerik takes an div:20
And in the telerik-settings.jpg you can see that I set the element formControlName find on top
Hope you can see the issue here and find a good solution. This will save me a ton of time :-)
Thanks,
Bjorn
Thank you for the additional information provided.
I suppose that in this case the problem is that the click to add the element is not performed on the element that contains that custom property. To be sure that the element is the one you want to click on - use highlighting when recording to locate the element in DOM first and then to add it in the Elements. Then check its find logic.
Let us know if you add the element with the custom property and its find logic still does not contain the desired property.
Regards,
Nikolay Petrov
Telerik by Progress
I selected the element in red with "Highlight Element" in the box I selected "Add to elements.." and gave it a name.
Unfortunately it gives the same value "div:20".
I added the source code so you might see why it's not working if you can reproduce it on your own computer. The element I am clicking is on line 250.
Thank you for the page source provided.
The problem here seems to be that the click is performed on the top element of the complete set of elements located under it. This top element is a div one. Using the highlighting to add the element to the repository completes the same action. This is the reason why the input is not selected by the additional find logic parameter. It is located under the div and it is not visible to be selected by highlighting feature.
I record a short video on how to add proper element to the repository and to fire an event attached to it. Note that in this case the element under consideration does not have size and if perform a MouseClick() on - it will not work properly.
When add custom property to the find logic make sure that it is in same format as the original property. The search logic is case sensitive.
I hope these directions are helpful.
Regards,
Nikolay Petrov
Telerik by Progress