之前写过QQ邮箱自动发送功能代码,但是上传附件用的是input.sendkeys(),今天使用AutoIt上传附件并加上注释,代码如下:
package selenium3;
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import com.CopyOfTestDama;
public class test003 {
public static void main(String[] args) throws InterruptedException, IOException {
System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://mail.qq.com/cgi-bin/loginpage");
Thread.sleep(3000);
try
{
//进入到login_frame里
driver.switchTo().frame(driver.findElement(By.id("login_frame")));
//点击账号密码登录按钮
driver.findElement(By.id("switcher_plogin")).click();
//输入账号
driver.fin