基于 SELENIUM 的自动化测试架构(40)
发表于:2017-04-11来源:gitbook作者:凌俣Linty?点击数:
标签:selenium
this .baseDriver.findElement(By.id(selector)); } else { // 用 分隔符 分成两个部分 String by = selector.split( this .byChar)[ 0 ]; String value = selector.split( this .byChar)[ 1 ]; we = find
this.baseDriver.findElement(By.id(selector));
}
else {
String by = selector.split(
this.byChar)[
0];
String value = selector.split(
this.byChar)[
1];
we = findElementByChar(by, value);
}
return we;
}
-
接下来的重点,是实现
findElementByChar(by, value)
private WebElement findElementByChar(String by, String value) {
WebElement we = null;
switch (by.toLowerCase()) {
case
原文转自:http://gitbook.cn/books/58e54b57cfcd6fa52dcef1d2/index.html