上传控件不适用于 Selenium Microsoft Edge 驱动程序
upload control did not working on Selenium microsoft edge driver
我使用 Selenium 3.0,并从 https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 版本 14393 下载 IE Edge 驱动程序以匹配我的 window 10 版本
这是我的控件
我的下拉列表控件没有任何问题,但上传控件的文本框中从来没有文件,上传按钮也不能正常工作。
EdgeDriver driver = new EdgeDriver();
driver.Url = "http://www.test.com";
IWebElement ddl = driver.FindElement(By.Id("ddlDocumentType"));
SelectElement select = new SelectElement(ddl);
select.SelectByIndex(2);
IWebElement fileUpload = driver.FindElement(By.Id("fileUploadControl"));
//Approach 1: SendKeys
string key = @"c:\test.pdf";
fileUpload.SendKeys(key);
Thread.Sleep(1000);
IWebElement btn = driver.FindElement(By.Id("btnSubmit"));
btn.Click();
Thread.Sleep(1000);
driver.Quit();
有人知道我在 Selenium IE Edge 文件上传自动测试中缺少什么吗?
您的问题与Edge Upload File control using Selenium相同。
答案,according to jhoward, is that unfortunately this is a known issue。
我使用 Selenium 3.0,并从 https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 版本 14393 下载 IE Edge 驱动程序以匹配我的 window 10 版本
这是我的控件
我的下拉列表控件没有任何问题,但上传控件的文本框中从来没有文件,上传按钮也不能正常工作。
EdgeDriver driver = new EdgeDriver();
driver.Url = "http://www.test.com";
IWebElement ddl = driver.FindElement(By.Id("ddlDocumentType"));
SelectElement select = new SelectElement(ddl);
select.SelectByIndex(2);
IWebElement fileUpload = driver.FindElement(By.Id("fileUploadControl"));
//Approach 1: SendKeys
string key = @"c:\test.pdf";
fileUpload.SendKeys(key);
Thread.Sleep(1000);
IWebElement btn = driver.FindElement(By.Id("btnSubmit"));
btn.Click();
Thread.Sleep(1000);
driver.Quit();
有人知道我在 Selenium IE Edge 文件上传自动测试中缺少什么吗?
您的问题与Edge Upload File control using Selenium相同。
答案,according to jhoward, is that unfortunately this is a known issue。