How to select many files using Windows file explorer with selenium webdriver

Yahya Hussein

I am automating a UI test where selecting file to upload is involved, I was able to automate the file selection using this solution.

WebElement filepath=driver.findElement(By.id("fileUploadId"));
filepath.sendKeys("C:\\TextFile.txt");

My issue is that I need to select many files to upload, is there a special format I should follow in the path I am sending? because I tried space-separated paths and it didn't work.

DebanjanB

To upload multiple files you can construct the character string adding all the absolute path of the files seperated by \n as follows:

WebElement filepath = driver.findElement(By.id("fileUploadId"));
filepath.sendKeys("C:/TextFile1.txt \n C:/TextFile2.txt \n C:/TextFile3.txt");

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to select item in group list in selenium webdriver

分類Dev

Selenium Webdriver using Ruby: write text to file

分類Dev

How to select date in selenium Webdriver from ajax calendarextender using C#

分類Dev

How to launch Safari with Selenium WebDriver using Java

分類Dev

Unable to click or select checkbox using selenium python webdriver chrome

分類Dev

How can I Paste a local file from Windows Explorer to Thunderbird using Ctrl+V?

分類Dev

How to use <mat-icon> tag value using Selenium Webdriver

分類Dev

How to get text of all options of dropdown in Selenium Webdriver using Ruby?

分類Dev

How would I interact with this input box in Selenium Webdriver using Java?

分類Dev

How to open url on another tab at same browser using selenium webdriver?

分類Dev

WebDriver Selenium browse file Java

分類Dev

Python asyncio/aiohttp: ValueError: too many file descriptors in select() on Windows

分類Dev

Windows explorer crashes on copying files

分類Dev

How does Windows Explorer give its file types?

分類Dev

How to take screenshot with Selenium WebDriver

分類Dev

Selenium WebDriver - how to use Assertions

分類Dev

How to count how many files exist in a directory with file size > 0?

分類Dev

How do I select an element in dropdown div menu in Selenium WebDriver? (Python)

分類Dev

How can click an option if SELECT list is define in a div with Selenium-webdriver & Java

分類Dev

Selenium webdriver- how to select a product when all products have same class (amazon.in)

分類Dev

using notepad++ to save file without name but not able using windows explorer

分類Dev

Unable to locate element using selenium webdriver in python

分類Dev

Using Python Selenium Webdriver to open Electron Application

分類Dev

Loading dynamic url using Selenium webdriver

分類Dev

Get span inside a class using WebDriver and Selenium

分類Dev

Selenium Webdriver (Java) - using AND/OR conditions in XPATH

分類Dev

Handling Date picker using Selenium WebDriver

分類Dev

Windows Explorer - keyboard shortcut to duplicate files/folders

分類Dev

WebDriver - Python - How many elements in a table

Related 関連記事

  1. 1

    How to select item in group list in selenium webdriver

  2. 2

    Selenium Webdriver using Ruby: write text to file

  3. 3

    How to select date in selenium Webdriver from ajax calendarextender using C#

  4. 4

    How to launch Safari with Selenium WebDriver using Java

  5. 5

    Unable to click or select checkbox using selenium python webdriver chrome

  6. 6

    How can I Paste a local file from Windows Explorer to Thunderbird using Ctrl+V?

  7. 7

    How to use <mat-icon> tag value using Selenium Webdriver

  8. 8

    How to get text of all options of dropdown in Selenium Webdriver using Ruby?

  9. 9

    How would I interact with this input box in Selenium Webdriver using Java?

  10. 10

    How to open url on another tab at same browser using selenium webdriver?

  11. 11

    WebDriver Selenium browse file Java

  12. 12

    Python asyncio/aiohttp: ValueError: too many file descriptors in select() on Windows

  13. 13

    Windows explorer crashes on copying files

  14. 14

    How does Windows Explorer give its file types?

  15. 15

    How to take screenshot with Selenium WebDriver

  16. 16

    Selenium WebDriver - how to use Assertions

  17. 17

    How to count how many files exist in a directory with file size > 0?

  18. 18

    How do I select an element in dropdown div menu in Selenium WebDriver? (Python)

  19. 19

    How can click an option if SELECT list is define in a div with Selenium-webdriver & Java

  20. 20

    Selenium webdriver- how to select a product when all products have same class (amazon.in)

  21. 21

    using notepad++ to save file without name but not able using windows explorer

  22. 22

    Unable to locate element using selenium webdriver in python

  23. 23

    Using Python Selenium Webdriver to open Electron Application

  24. 24

    Loading dynamic url using Selenium webdriver

  25. 25

    Get span inside a class using WebDriver and Selenium

  26. 26

    Selenium Webdriver (Java) - using AND/OR conditions in XPATH

  27. 27

    Handling Date picker using Selenium WebDriver

  28. 28

    Windows Explorer - keyboard shortcut to duplicate files/folders

  29. 29

    WebDriver - Python - How many elements in a table

ホットタグ

アーカイブ