Testing Angular Material Components

404 views
Skip to first unread message

John Jai

unread,
Sep 26, 2018, 5:20:00 AM9/26/18
to Selenium Users
Hi all, 

We need to test angular material components : https://material.angular.io/components/select/overview. When we try to select a <mat-select> field using Select locator it's erring out since it's a <mat-select> and not a <select> tag.

Our code:
final Select selectable = new Select(this.findElement(ExpectedConditions.elementToBeClickable(locator)));

Error received:
org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "mat-select"

Selenium org.openqa.selenium.support.ui.Select code:
if (null == tagName || !"select".equals(tagName.toLowerCase())) {
      throw new UnexpectedTagNameException("select", tagName);
}

Is there a version of webdriver that helps test mat-select and other Angular material components? We use selenium 3.4 maven dependency.

Thanks much!
John Jai
Reply all
Reply to author
Forward
0 new messages