Answered

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

-1
22 comments
Avatar
Joseph Hamdan

Hi Neema,

Would you please elaborate on what you mean by desktop does not seem to work? What exactly is happening when using Desktop commands?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Neema Sukumaran

Tried to click Save button using desktop command.  But its not clicking the Save button

0
Comment actions Permalink
Avatar
Neema Sukumaran

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Neema,

Are you seeing highlight around the Save button? If not, please enable it in User Execution Preferences > Desktop Highlight.

After that, if it still does not work, please try replacing the image with a new one. 

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Neema Sukumaran

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

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Neema,

In order to better help, I need to understand what the issue is. Would you please clarify on what is happening when executing Desktop_Click on Save?

Are you using an image or Use Text option?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Neema Sukumaran

Hi Joseph,   Thanks for responding. I was using the Text option. verified that Desktop highlight option is checked in settings.But still the Save button is not clicking

0
Comment actions Permalink
Avatar
Neema Sukumaran

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.

 

 

 

-1
Comment actions Permalink
Avatar
Joseph Hamdan

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

0
Comment actions Permalink
Avatar
Neema Sukumaran

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

0
Comment actions Permalink
Avatar
Joseph Hamdan

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

0
Comment actions Permalink
Avatar
Neema Sukumaran

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.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Neema,

Please make sure that the download is completed and the file is actually available in the path, otherwise verification will not work. Please attach screenshots from the platform and Windows if this issue persists.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Neema Sukumaran

Hi Joseph,  the file doesnt seem to get downloaded in the folder specified in User Preferences.Please let me know if this helps or need morescreenshots

0
Comment actions Permalink
Avatar
Joseph Hamdan

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

0
Comment actions Permalink
Avatar
Neema Sukumaran

Hi Joseph,  Tried as you mentioned.  But still doesnt seem like its downloading to Downloads.  Will clearing the server cache help. If possible, Can we have a quick troubleshooting session. 

0
Comment actions Permalink
Avatar
Joseph Hamdan

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

0
Comment actions Permalink
Avatar
Neema Sukumaran

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 

0
Comment actions Permalink
Avatar
Rex Feizi

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

0
Comment actions Permalink
Avatar
Neema Sukumaran

Thank You Rex.  Appreciate it. Will check with Dhana, try and let know

0
Comment actions Permalink
Avatar
Neema Sukumaran

Hi Rex/Joseph,

  Dhana confirmed that the default folder for downloads is C:\proof\Automation_Downloads.  Updated the testcase and it passed in cloud .  Thanks for helping with this

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Neema,

Not a problem, glad it's working out. Enjoy the rest of your day!

Regards,
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.