【发布时间】:2016-08-29 09:51:57
【问题描述】:
我想上传两个图像 (.png) 文件。我使用操作键和发送键来上传文件。它对一个文件工作正常,但如果我想再次上传第二个图像文件,文件没有得到已上传。
Actions action1 = new Actions(m.driver);
action1.moveToElement(m.driver.findElement(By.id("onetidIOFile"))).click();
WebElement s=m.driver.findElement(By.xpath("//input[@type='file']"));
s.sendKeys("path of one file");m.click("xpath", ".//[@id='attachOKbutton']");
m.click("id", "Ribbon.ListForm.Edit.Actions.AttachFile-Large");
action1.moveToElement(m.driver.findElement(By.id("onetidIOFile"))).click();
m.driver.findElement(By.xpath("//input[@type='file']")).sendKeys("path of second file ");
m.key("Enter","attachOKbutton");
谁能帮我做这个???
【问题讨论】:
-
添加您的代码和 html。
-
不要将代码粘贴为评论,而是编辑您的问题