Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Common methods for the basic elements of Selenium scripts

Shulou Source: shulou.com Published: 2022-06-03 05:34:34 11月24日 Update

Basic elements of the page:

1. Method of uploading pictures

Private static void fileUpload (WebDriver driver, String s, String filepath) {

WebElement file = driver.findElement (By.name (s))

File.sendKeys (filepath)

}

Call:

FileUpload (driver, "file", "C:\ pictures\\ pic1.jpg")

Tags: Elements methods pictures pages commonly used scripts Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple OPPO Reno MariaDB Docker