如何配置Selenium WebDriver?我有使用Selenium和Java的自動化測試用例。現在我需要使用WebDriver自動上傳和下載文件。我已經添加了webdriver-common-0.9.7376.jar。我喜歡使用Internet Explorer。我怎樣才能做到這一點?配置Selenium 2(WebDriver),使用IE並使用WebDriver上傳文件
我只是聲明變量,使用驅動程序
private static WebDriver driver;
driver.findElement(By.id(upload)).sendKeys("file to be upload");
這是正確的嗎?
獲取上傳元素並輸入文件名的原理是正確的。當你嘗試時會發生什麼? – beny23