java工作复习——4大时间等待——强制等待(Thread.sleep(5000);)
2021-02-09 07:19
标签:rgs ndk click dcs read 时间 drive row form java工作复习——4大时间等待——强制等待(Thread.sleep(5000);) 标签:rgs ndk click dcs read 时间 drive row form 原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12751245.htmlpackage jkcs;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class jdcs
{
public static void main(String[] args) throws InterruptedException
{
System.setProperty("webdriver.chrome.bin","?C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //设置安装路径,防止系统找不到
WebDriver driver = new FirefoxDriver(); //初始化FireFox浏览器实例,并打开浏览器
driver.manage().window().maximize(); //最大化窗口
driver.navigate().to("http://www.baidu.com");
Thread.sleep(5000);
driver.findElement(By.id("kw")).sendKeys("china"); //文本框里输入
Thread.sleep(5000);
Actions sj = new Actions(driver);
sj.click(driver.findElement(By.id("su"))).perform(); //模拟鼠标左击
Thread.sleep(8000);
driver.quit();
}
}
文章标题:java工作复习——4大时间等待——强制等待(Thread.sleep(5000);)
文章链接:http://soscw.com/index.php/essay/52999.html