selenium的十大定位方法
- By.id
- By.name
- By.className
- By.tagName
- By.LinkText
- By.xpath
- By.cssSeclector
- By.partialLinkText
常见元素处理
基本代码演示
package com.test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.PageFactory;
/**
* @author Huangtian
* @create 2019-03-11 8:49
*/
public class Init_Page {
/**
* 页面工厂类
* 所有的页面继承这个父类
* 获得ChromeDriver
*/
public WebDriver driver = new ChromeDriver();
public Init_Page() {
System.setProperty("webdriver.chrome.driver