How to Upload a File with Watir and Ie

How to upload a file with watir and IE?

I knew about that problem, and completely forgot! Go to input_elements.rb file in your gems directory, and add the title of the file upload window in your language to POPUP_TITLES (line 443).

Example:

  • before

    POPUP_TITLES = ['Choose file', 'Choose File to Upload']
  • after

    POPUP_TITLES = ['Choose file', 'Choose File to Upload', 'File upload in my language']

Selecting local files using watir-webdriver

Try using the following function:

@browser.file_field(:id,"upload").set("filepath")

Also, if you are using IE browser then make sure you are using IEDriverServer_Win32_2.33.0 as it works fine on this driver not on latest one.



Related Topics



Leave a reply



Submit