三、WebDriver API__1.定位元素方法总览

Webdriver提供了八种元素定位方法:
Webdriver提供了八种元素定位方法,对应Java语法:
id -----> findElement(By.id()); 或者 findElements(By.id());
name -----> findElement(By.name());
class name -----> findElement(By.className());
tag name -----> findElement(By.tagName());
link text -----> findElement(By.linkText());
partial link text -----> findElement(By.partialLinkText());
xpath -----> findElement(By.xpath());
css selector -----> findElement(By.cssSelector());

猜你喜欢

转载自www.cnblogs.com/surenliu/p/12332670.html