How to upload a file with watir and IE?

前端 未结 5 1360
情歌与酒
情歌与酒 2020-12-18 01:07

I am writing a watir script to test an upload form.

But the script does not automatically choose the file that is to be uploaded from my harddrive.

Instead I

5条回答
  •  遥遥无期
    2020-12-18 02:00

    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']
      

提交回复
热议问题