5

Script to upload a file,in selenium IDE or How to automate uploading a file using selenium

Sirs
  • 1,277
  • 17
  • 30
user1211231
  • 49
  • 1
  • 4

1 Answers1

4

You can use

selenium.type("xpath of text box","path of your file")

command=type
target=xpath_of_text_box
value=Path_of_your_file

example:

selenium.type("id=cvfile", "D:\\Automation\\resume.doc");
Johan
  • 74,508
  • 24
  • 191
  • 319
  • 1
    This solution is for Selenium WD and not Selenium IDE – GIZNAJ Jun 19 '17 at 14:36
  • ... and what would you do if the target is missing an `id` but has a class one parent up, but is the second sibling in the HTML code? – MeSo2 May 25 '23 at 04:28