下面列出了org.openqa.selenium.remote.RemoteWebElement#sendKeys ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) {
if (fileName.isEmpty()) {
fileBoxElement.clear();
} else {
fileBoxElement.setFileDetector(new UselessFileDetector());
String filePath = new File(fileName).getAbsolutePath();
fileBoxElement.sendKeys(filePath);
}
}
protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) {
if (fileName.isEmpty()) {
fileBoxElement.clear();
} else {
fileBoxElement.setFileDetector(new UselessFileDetector());
String newFilePath = new File(fileName).getAbsolutePath();
fileBoxElement.sendKeys(newFilePath);
}
}