selenium 通过id,name,class,css,xpath,tag,linktext,partial link 定位web 页面元素
文本框交互:可以通过SendKeys 方法把值转换成文本框内
单选按钮:可以使用click 方法选中按钮
复选框交互:可以使用click 方法选中按钮
下拉框交互:可以使用"selectByVisibleText"或"selectByIndex"或"selectByValue"的方法选择一个选项
拖放:
将Disabled Node 拖到Parent Node 下面
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.interactions.Action;
public class webdriverdemo
{
public static void main(String[] args) throws InterruptedException
{
WebDriver driver = new FirefoxDriver();
//Puts a Implicit wait, Will wait for 10 seconds before throwing exception
driver.manage().timeouts().i