Multiple files upload in selenium webdiver

后端 未结 4 2084
鱼传尺愫
鱼传尺愫 2021-01-15 23:50

I want to upload 5 files,but my \'file input\' is same name/id,how can i possible to upload five files. My HTML code is:

4条回答
  •  温柔的废话
    2021-01-16 00:20

    This works on Chrome:

    driver.findElement(By.id("input1")).sendKeys("path/to/first/file-001 \n path/to/first/file-002 \n path/to/first/file-003");
    

提交回复
热议问题