public class By
extends java.lang.Object
SearchContext.findElement(By)
method.
Modifier and Type | Class and Description |
---|---|
static class |
By.Type |
Modifier and Type | Method and Description |
---|---|
static By |
className(java.lang.String className)
Constructs
构造By方法,该方法根据给定的class属性在加载的文档中查找所有元素。 By method that finds all elements inside loaded document by given
class attribute.
|
static By |
cssSelector(java.lang.String cssSelector)
Constructs
构造By方法,使用给定的cssSelector查找加载的文档中的所有元素。 By method that finds all elements inside loaded document with given
cssSelector .
|
By.Type |
getType()
Returns find method type.
返回查找方法类型。 |
java.lang.String |
getValue()
Returns find method parameter.
返回查找方法参数。 |
static By |
id(java.lang.String id)
Constructs
构造By方法,该方法根据给定的ID查找加载的文档中的所有元素。 By method that finds all elements inside loaded document by given
id .
|
static By |
name(java.lang.String name)
Constructs
构造By方法,该方法根据给定的name属性在加载的文档中查找所有元素。 By method that finds all elements inside loaded document by given
name attribute.
|
static By |
tagName(java.lang.String tagName)
Constructs
构造By方法,该方法查找具有给定tagName的已加载文档中的所有元素。 By method that finds all elements inside loaded document with given
tagName .
|
static By |
xpath(java.lang.String xpath)
Constructs
构造By方法,使用给定的xpath表达式查找已加载文档中的所有元素。 By method that finds all elements inside loaded document with given
xpath expression.
|
public static By id(java.lang.String id)
By
method that finds all elements inside loaded document by given
id
.
id
- value of element's
id
attribute.
-元素属性的值。
By
method.
方法的新实例。
public static By className(java.lang.String className)
By
method that finds all elements inside loaded document by given
class
attribute.
className
- value of element's
class
attribute.
-元素属性的值。
By
method.
方法的新实例。
public static By name(java.lang.String name)
By
method that finds all elements inside loaded document by given
name
attribute.
name
- value of element's
name
attribute.
-元素属性的值。
By
method.
方法的新实例。
public static By tagName(java.lang.String tagName)
By
method that finds all elements inside loaded document with given
tagName
.
tagName
- a string that represents tag name.
-代表标签名称的字符串。
By
method.
方法的新实例。
public static By xpath(java.lang.String xpath)
By
method that finds all elements inside loaded document with given
xpath
expression.
xpath
- a string that represents xpath expression.
-表示xpath表达式的字符串。
By
method.
方法的新实例。
public static By cssSelector(java.lang.String cssSelector)
By
method that finds all elements inside loaded document with given
cssSelector
.
cssSelector
- a string containing one or more CSS selectors separated by commas.
-包含一个或多个用逗号分隔的CSS选择器的字符串。
By
method.
方法的新实例。
public java.lang.String getValue()
public By.Type getType()