亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在Java中使用Selenium WebDriver登錄Gmail

在Java中使用Selenium WebDriver登錄Gmail

冉冉說 2019-10-04 15:32:52
import java.util.concurrent.TimeUnit;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.firefox.FirefoxDriver;import org.openqa.selenium.support.ui.ExpectedConditions;import org.openqa.selenium.support.ui.WebDriverWait;public class NewGmail {    public static void main(String[] args) {            WebDriver driver = new FirefoxDriver();            driver.manage().window().maximize();            String url = "https://accounts.google.com/signin";            driver.get(url);            driver.findElement(By.id("identifierId")).sendKeys("cp8805");             //driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);                  WebDriverWait wait=new WebDriverWait(driver, 20);                           driver.findElement(By.xpath("//span[@class='RveJvd snByac']")).click();                     driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);                    driver.findElement(By.xpath("//input[@class='whsOnd zHQkBf']")).sendKeys("xxxxxx");                         driver.findElement(By.xpath("//span[@class='RveJvd snByac']")).click();     }  }郵件ID后,我的密碼也會寫在ID框選項中,并且服務器重定向到下一個密碼頁面。我想問一下我該怎么做,以便僅在密碼頁面中輸入我的密碼。
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 396 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號