public enum ByType extends Enum<ByType>
文件名:ByType.java
用途:用于枚举出能被识别的元素定位方式
编码时间:2019年10月24日下午5:18:57
修改时间:修改时间:2022年12月13日 上午8:03:18
Enum Constant and Description |
---|
CLASSNAME
通过className方式进行定位
|
CSS
通过css方式进行定位
|
ID
通过id方式进行定位
|
LINKTEXT
通过linkText方式进行定位
|
NAME
通过name方式进行定位
|
TAGNAME
通过tagName方式进行定位
|
XPATH
通过xpath方式进行定位
|
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.By |
getBy(String value)
根据枚举内容,返回相应的
By 对象 |
String |
getValue()
返回元素定位枚举对应的定位方式名称
|
static ByType |
typeText2Type(String typeText)
该方法用于将枚举文本转换为消息枚举
|
static ByType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ByType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ByType XPATH
public static final ByType CSS
public static final ByType CLASSNAME
public static final ByType ID
public static final ByType LINKTEXT
public static final ByType NAME
public static final ByType TAGNAME
public static ByType[] values()
for (ByType c : ByType.values()) System.out.println(c);
public static ByType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getValue()
public org.openqa.selenium.By getBy(String value)
By
对象value
- 元素的定位内容By
对象Copyright © 2024. All rights reserved.