← Quiz: Web Elements: all 10 questions
Quiz: Web Elements · Question 4 of 10
How do you upload a file with Selenium?
How do you upload a file with Selenium?
- A.Click the button and use the Windows dialog
- B.Call sendKeys with the file path on the input type="file" element
- C.Use the Select class
- D.It's impossible
Answer & explanation
Correct answer: Call sendKeys with the file path on the input type="file" element
The browser receives the path directly.
Can you get the rest right without peeking?
Take the timed Quiz: Web Elements quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →