-2

How to handle windows file upload and download through script using protractor?Windows file Upload Image

MonaS
  • 7
  • 1

1 Answers1

0
<input name="upload" type="file">

Upload Solution:

var absolutePath = path.join(__dirname,'..\\..\\dash-e2e-tests\\resources\\files-cabin\\test-files\\image.png);

element(by.xpath("xpath")).sendKeys(absolutePath);

Download Solution:

capabilities: {
    browserName: 'chrome',
    'chromeOptions': {
        prefs: {
            download: {
                'prompt_for_download': false,
                'directory_upgrade': true,
                'default_directory': downloadfile
            }
        }
    }

},