🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Click the button and use the Windows dialog
  2. B.Call sendKeys with the file path on the input type="file" element
  3. C.Use the Select class
  4. 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 →