三、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());