Protractor: Not able to download any file using Protractor

Created on 28 Jun 2019  路  19Comments  路  Source: angular/protractor

We are facing download issue while using Protractor 5.4.1 version. It was working fine till last week. There is no API issue in Application as well.
We have mentioned download destination file in chrome options. Need your help here

All 19 comments

hi @pranesh517,

Can you please provide the capabilities you've specified in 'chromeOptions'. Also please make sure the downloadDir path is correct and it is available. In few cases if the path is not valid, file doesn't get downloaded in the specified folder.

chromeOptions: {
prefs: {
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: path_to_dir
}
}
}

Folder path provided is available in the directory.

We are facing download Error issue when we clicked on download button

Hi @pranesh517 ,

What i can suggest is, try to put the complete path 'C:\Users\user\Desktop\project\downloadDir' instead of 'path_to_dir' and try to run your test. if throws an error, can you please post err log here it might be helpful to debug.

Thanks !

tried with providing exact DIR path as well.. Getting issue "Failed- Download Error"
Log is showing error on the next line where we are accessing the downloaded file.

Download functionality is working fine with Previous versions of chrome apart from 75. Error is only for Chrome 75 latest version.

Same issue for me, no downloads allowed with protractor and Chrome 75

facing same issue from last few days.

The same function was working about a couple of days ago, The page refreshes when we click on the download button and the file doesn't get downloaded.

Hi @naman-goel , @arjunUnniumbath @fdc80 @pranesh517 . Here is an update chrome 75 is built to follow W3C standards(web-driver protocol) has few deprecated API. So if you're using chrome 75 using chromedriver 74 version might resolve the issue.

To do this you can downgrade [email protected] which downloads chrome 74 driver. it may resolve your issue.

[email protected] will install chromedriver 75 version.

Thanks!

@Harsha509 : We are using "webdriver-manager": "12.1.1" and Protractor V 5.4.2, still execution happens on Chrome 75. Is there any other capability we need to mention?

Hi @pranesh517, here is info

[email protected] downloads chromedriver 2.46 which supports chrome versions 71-73. So somewhere (in your local repo, or globally) there is webdriver [email protected] installed. to conform this please do the following.

Step 1: open command prompt & check webdriver-manager version
step 2: open you protractor proj dir -> node_modules -> .bin -> webdriver-manager version

If you're using directConnect: true protractor picks up the chrome driver from local repo (step 2)

(or)

You can pass the log when you run the tests using protractor conf.js (or) when you do webdriver-manager start. it will help me to find the issue.

Thanks!

@Harsha509 :+1: Yes we are using directConnect: true.
I found below webdriver manager versions
Step 1: 12.0.6
Step 2: 12.1.1

As of today my local Chrome browser got updated to latest 76 version...

Please suggest what i need to do here...

I found this webdriver manager versions instead:
Step 1: 12.1.0
Step 2: 12.1.0
My Chrome version is 75 e when i try to update with command "webdriver-manager update" nothing changes, it returns version 12.1.0

@Harsha509 : Is there any alternative to use Chrome V76 with Webdriver Manager 12.1.5 and Protractor 5.4.2? Since i am facing an issue for launching chrome browser now...

I solved with a downgrade of Chrome.... no other solution possible. You only can downgrade if you uninstall and reinstall an older version of chrome, you can find it here.

I hope this helps.
Bye

@Harsha509 still seeking help for :

@Harsha509 +1 Yes we are using directConnect: true.
I found below webdriver manager versions
Step 1: 12.0.6
Step 2: 12.1.1

As of today my local Chrome browser got updated to latest 76 version...

Please suggest what i need to do here...

@Harsha509 still seeking help for :

@Harsha509 +1 Yes we are using directConnect: true.
I found below webdriver manager versions
Step 1: 12.0.6
Step 2: 12.1.1

As of today my local Chrome browser got updated to latest 76 version...

Please suggest what i need to do here...

Read my answer above

@pranesh517 , this is strange. Downgrade to chrome 74 and use [email protected] will resolve the issue for now as @fdc80 suggests.

Regarding the issue of the newest version of Chrome, the guys from webdriver-manager released version 12.1.6 which supports Chrome 76. You need to run a:
yarn upgrade protractor

WIth that you will get latest version of webdriver-manager. You can verify it in the yarn.lock file or node_modules folder.

Was this page helpful?
0 / 5 - 0 ratings