Sequel to Question based on Disabling command Prompt
As a sequel to the post 'How can we add chrome preferences for enabling/disabling download prompt' - We have a similar situation and not able to disable the prompt while downloading (its controlled by the organization)in settings. Desktop_command doesnt seem to work too. is there a desktop short_key for this
Hi Joseph, We have to use desktop commands for login process for another set of testcases too. But desktop commands doesnt seem to work for me. You have helped me earlier with this and since it dint work, used hot_keys instead and worked previously. Can you please help me with this
Hi Joseph, i tried different Desktop_hotkey combinations and was able to verify the following LOCALLY
- click 'Save' button,
- download and
- verify the downloaded file
. But when i run it in cloud, its failing at the step where it tries to verify the file. The path given is C:\Users\Administrator\Downloads\nhlbi-clinical-trials-import.csv. Can see the file getting downloaded in video. Is it getting saved in a different location
Error message: File nhlbi-clinical-trials-import.csv was selected for the verification.
File C:\proof\xpoint_2022_10_20_13_38\bin\nhlbi-clinical-trials-import.csv is absent.
Hi Neema,
Would you please try adding these options in User Execution Preferences > Advanced > next to Chrome?
Please pick your username, here it's listed as Admin. To answer your question, the name in cloud may not be the same as for local execution so it needs to reflect the actual folder name.
javaScriptEnabled=true chromeOptions=["--start-maximized", "--ignore-certificate-errors"] prefs=["plugins.always_open_pdf_externally=true","download.prompt_for_download=false","download.default_directory=C:\Users\Admin\Downloads","download.open_pdf_in_system_reader=false","profile.default_content_settings.popups=0"]
Regards,
Subject7 Team
Hi Joseph, Thanks. I added these to user preferences for chrome. One doubt - is this for pdf files alone or for all extensions. The file type i am trying to download is csv. Eventhough the download folder provided is C:\Users\<my-username>\Dowloads, error message in failed step mentions
C:\proof\xpoint_2022_10_20_14_07\bin\nhlbi-clinical-trials-import.csv was selected for the verification.
File C:\proof\xpoint_2022_10_20_14_07\bin\nhlbi-clinical-trials-import.csv is absent.
I can see the file is getting downloaded. Is there a way to validate that the csv file is downloaded. Is there a way to know the folder its being downloaded to. I just need to verify that file is being downloaded
Hi Neema,
Could you please try the below? It should work with all file types regardless of extension
javaScriptEnabled=true chromeOptions=["--start-maximized", "--ignore-certificate-errors"] prefs=["download.prompt_for_download=false","download.default_directory=C:\Users\Admin\Documents"]
About the download path, the above already points out where the download is going to be, you can change from Documents to another folder. Please also make sure that the file name is the same. After that, Verify_File_Download should do the rest.
Regards,
Subject7 Team
Thanks I tried that.
javaScriptEnabled=true
chromeOptions=["--start-maximized", "--ignore-certificate-errors"]
prefs=["download.prompt_for_download=false","download.default_directory=C:\Users\sukumarann2\Downloads"]
Also tried with following 2 sets of Steps and WITHOUT any navigation steps and just verification in download folder. Still the validation step is failing
1. GoTo_url C:\Users\sukumarann2\Downloads
Verify_File_download nhlbi-clinical-trials-import.csv
2. GoTo_url C:\proof\xpoint_2022_10_20_13_37\bin
Verify_File_download nhlbi-clinical-trials-import.csv
Error Message: File nhlbi-clinical-trials-import.csv was selected for the verification.
File C:\proof\xpoint_2022_10_20_13_37\bin\nhlbi-clinical-trials-import.csv is absent.
Hi Neema,
Ok, can you please try without the directory being specified? Here are the options. If download succeeds, the file should go directly under Downloads and you only need to specify the path in Verify_File_Download command.
javaScriptEnabled=true chromeOptions=["--start-maximized", "--ignore-certificate-errors"] prefs=["download.prompt_for_download=false"]
Please let me know if this works or not.
Regards,
Subject7 Team
Hi Neema,
Sure, please let me know your availability tomorrow. I am available from 9 AM to 12 PM EST.
Until we meet, has any policy changed on these virtual machines to store downloads? There may have been a policy where downloads are placed in the C drive (folder such as Automation) ?
Regards,
Subject7 Team
Thanks Joseph. I am available from 10-11:30am tomorrow. Regrading policy changes, I am not aware of any changes. Its working locally. and the error message mentions a different path for the downloaded files[C:\proof\xpoint_2022_10_20_13_37\bin\nhlbi-clinical-trials-import.csv]. So thinking it might be, by default, downloading to a default folder in case of cloud execution and for local run, the folder user choose
Neema,
The automation test should not depend on the user's directory/folder, otherwise, it won't work for cloud runs. As a result, a long time ago, NHLBI created a group policy where the default download folder was changed from c:/users/<username>/downloads to c:/automation_downloads or some other paths that I cannot recall. If you check with IT/Operations Dhana he should know that.
Also regarding the file save popup, this was a browser setting that was another group policy enforcing silent download without nay popup.
Thanks,
--Rex
Please sign in to leave a comment.