Example usage for org.openqa.selenium.support.ui UnexpectedTagNameException UnexpectedTagNameException

List of usage examples for org.openqa.selenium.support.ui UnexpectedTagNameException UnexpectedTagNameException

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui UnexpectedTagNameException UnexpectedTagNameException.

Prototype

public UnexpectedTagNameException(String expectedTagName, String actualTagName) 

Source Link

Usage

From source file:org.zanata.util.Checkbox.java

License:Open Source License

private Checkbox(WebElement element) {
    String tagName = element.getTagName();
    if (null == tagName || !"input".equals(tagName.toLowerCase())) {
        throw new UnexpectedTagNameException("input", tagName);
    }/*  w  ww  .  jav  a  2s .  co  m*/

    String type = element.getAttribute("type");
    if (type == null || !"checkbox".equals(type.toLowerCase())) {
        throw new IllegalArgumentException("element is not a checkbox");
    }
    this.chkElement = element;
}