This is a migrated thread and some comments may be shown as answers.

Angular 2 - Find Logic

5 Answers 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
neutcomp
Top achievements
Rank 2
neutcomp asked on 17 Feb 2017, 02:38 PM

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

Sort by
0
Nikolay Petrov
Telerik team
answered on 22 Feb 2017, 10:22 AM
Hello Bjorn,

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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
neutcomp
Top achievements
Rank 2
answered on 22 Feb 2017, 11:03 AM

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

 

0
Nikolay Petrov
Telerik team
answered on 24 Feb 2017, 04:25 PM
Hi 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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
neutcomp
Top achievements
Rank 2
answered on 27 Feb 2017, 03:06 PM

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. 

0
Nikolay Petrov
Telerik team
answered on 02 Mar 2017, 12:57 PM
Hi Bjorn,

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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
neutcomp
Top achievements
Rank 2
Answers by
Nikolay Petrov
Telerik team
neutcomp
Top achievements
Rank 2
Share this question
or