Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Se (10)-upload files

Shulou Source: shulou.com Published: 2022-06-03 06:21:16 11月23日 Update

Package test

Import org.openqa.selenium.By

Import org.openqa.selenium.WebDriver

Import org.openqa.selenium.WebElement

Import org.openqa.selenium.chrome.ChromeDriver

Import org.testng.annotations.Test

Public class lesson9 {

@ Test

Public void test () throws InterruptedException {

System.setProperty ("webdriver.chrome.driver", "DJV 01 Learn WebDriver/chromedriver.exe")

WebDriver dr = new ChromeDriver ()

Dr.manage (). Window (). Maximize ()

Dr.get ("http://www.layui.com/demo/upload.html");"

Thread.sleep (3000)

/ / upload files

WebElement el1 = dr.findElement (By.id ("test"))

El1.sendKeys ("d:/1.jpg")

/ / dr.quit ()

}

}

Tags: File Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple OPPO Reno MySQL Huawei