selenium 上传文件。

上传文件 
driver.findElement(By.xpath("//input[@type='file']"))).sendKeys("C:\testContent.pdf");

action

Actions actionObject = new Actions(driver);           

 actionObject.keyDown(Keys.CONTROL).sendKeys(Keys.F5).keyUp(Keys.CONTROL).perform();   

原文地址:https://www.cnblogs.com/wcLT/p/3386048.html