cancel
Showing results for 
Search instead for 
Did you mean: 

Is Testcomplete compatible with Angular Material?

Highlighted
Occasional Contributor

Is Testcomplete compatible with Angular Material?

I have this html , taken from https://material.angular.io/components/select/overview 

 

To see the rendering of the code below go to https://stackblitz.com/angular/vvqbegyprlm?file=package.json

 

<form>
  <h4>mat-select</h4>
  <mat-form-field>
    <mat-select placeholder="Favorite food" [(ngModel)]="selectedValue" name="food" role="SELECT">
      <mat-option *ngFor="let food of foods" [value]="food.value">
        {{food.viewValue}}
      </mat-option>
    </mat-select>
  </mat-form-field>
  <p> Selected food: {{selectedValue}} </p>
  <h4>native html select</h4>
  <mat-form-field>
    <select matNativeControl placeholder="Favorite car" [(ngModel)]="selectedCar" name="car">
      <option value="" selected></option>
      <option *ngFor="let car of cars" [value]="car.value">
        {{car.viewValue}}
      </option>
    </select>
  </mat-form-field>
  <p> Selected car: {{selectedCar}} </p>
</form>
 

when I spy this object it finds all the panels for the <div class...> objects but doesnt recognize the <mat-select class...>  but it  correctly identifies native html select <select> with wSelectedItem property .

 

Does Testcomplete not support custom html tags? Or is it somehow possible to add those custom html tags to the object spy

5 REPLIES 5
Community Hero

Re: Is Testcomplete compatible with Angular Material?

Hi,

 

> Is Testcomplete compatible with Angular Material?

Yes, it is. TestComplete is compatible with any library that produces html markup. Fantastic description from @LinoTadros can be found here: https://community.smartbear.com/t5/TestComplete-Functional-Web/TestComplete-9-3-Does-it-support-kend...

 

> Does Testcomplete not support custom html tags?

If I remember it correctly, anyone can introduce any tag and use it in the html markup. Browsers just ignore non-standard tags and it is up to your page script code how to treat and handle them (e.g. as combo-box, as an option button, etc.).

TestComplete provides some support for the most popular libraries but in most cases it is your responsibility to figure out how to identify such custom elements and how to handle them. Just because all native handling of such custom html tags is provided by custom script code that can be altered at any moment by its author.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Is Testcomplete compatible with Angular Material?

Thanks for the reply @AlexKaras  , I will conclude that the current Testcomplete does not have support for Angular Material framework . It has full support for standard html components  including the specified ones specified on the page https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/index.h... only .

 

Regards.

Community Hero

Re: Is Testcomplete compatible with Angular Material?

Hi,

 

> It has full support for standard html components [...] only .

Not exactly Smiley Wink

You may consider also https://support.smartbear.com/testcomplete/docs/app-testing/web/web-components/custom-elements.html and https://support.smartbear.com/testcomplete/docs/app-testing/web/general/object-identification/using-... options.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Is Testcomplete compatible with Angular Material?

Hi ,

zz.PNGPlease go to the link https://material.angular.io/components/select/overview and try to spy on the select item and show me a screenprint like so 

on the two select elements below the Basic select heading.

Community Hero

Re: Is Testcomplete compatible with Angular Material?

Hi,

 

Well, I can see exactly the same as on your screenshot.

Summary: page is supported and correctly recognized by TestComplete.

 

The control you are referring to is marked up as 'select' and has id attribute with the value of 'mat-input-0'. This can be seen as the values of the corresponding properties in the Object Browser (namely: ObjectType, ObjectIdentifier and outerHTML). Thus TestComplete identifies the given web element as Select("mat_input_0") in the Object Tree (with the dashes replaced with underscores) and you may search for the object and address it in your test code using the above properties.

Yes, all web elements above the one been discussed do not have identifiers and this means that you will have inconveniences when working with the page. But this is not the problem of TestComplete but the usual problem of web page design when web elements are not assigned unique identifiers. For whatever reason developers use for their excuse.

 

So, what does not work for you?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================