zoukankan      html  css  js  c++  java
  • java工作复习——4大时间等待——强制等待(Thread.sleep(5000);)

    package 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();
        }
    }
  • 相关阅读:
    uniapp 请求附近地址列表
    uniapp 图片视频上传
    城市定位
    日历签到
    uniapp拼团倒计时函数
    时间过滤器
    倒计时函数
    vuex的使用
    毛玻璃效果
    Pullword 中文分词
  • 原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12751245.html
Copyright © 2011-2022 走看看