Case Status
Log In

Wiki

Options

 
Uploading Files Using Selenium…
  • RSS Feed

Last modified on 1/29/2016 4:14 PM by User.

Uploading Files Using Selenium Webdriver

Selenium Webdriver using the IE,Chrome and Firefox drivers are Web application only, therefore in a test where a file needs to be uploaded there can be some difficulty with uploading a file to the target application.

This action is made to send a file up without having to click the browse button.

In the action map it will look something similar to the following:


set.savefile %REFERENCE%FindElement("&properties&").SendKeys("C:\\TEST\\TestDoc7.XYZ")

NB The double backslashes are required as escape characters in C#.

 

In the Object Map the following or similar is required:

Class: TextField and Properties: Xpath=//input[@type='file']

An example of this action in use, with a static wait beforehand is:

Wait(4000);set.savefile