How to set download path for EdgeDriver using EdgeOptions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set download path for EdgeDriver using EdgeOptions

Sagar Gulhane
I am using selenium 3.141 with C# I would like to set the download path using EdgeOptions. Please any one can help me with this. 

Current code I am using as below which is not working need to know the correct capabilities to add for Edge driver

  EdgeOptions edgeOptions = new EdgeOptions();
                edgeOptions.AddAdditionalCapability("download.default_directory", {Path});
                edgeOptions.AddAdditionalCapability("download.prompt_for_download", "false");

                driver = new EdgeDriver(edgeOptions);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7d92186b-c911-4c17-bb02-f089e6335d7co%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to set download path for EdgeDriver using EdgeOptions

Mark Collin-2
Have a read of this:

https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html

On Thursday, 25 June 2020 07:53:07 UTC+1, Sagar Gulhane wrote:
I am using selenium 3.141 with C# I would like to set the download path using EdgeOptions. Please any one can help me with this. 

Current code I am using as below which is not working need to know the correct capabilities to add for Edge driver

  EdgeOptions edgeOptions = new EdgeOptions();
                edgeOptions.AddAdditionalCapability("download.default_directory", {Path});
                edgeOptions.AddAdditionalCapability("download.prompt_for_download", "false");

                driver = new EdgeDriver(edgeOptions);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/d89cf89d-2095-4491-be4b-4acbb938e09eo%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to set download path for EdgeDriver using EdgeOptions

Sagar Gulhane
Thanks Mark,

For suggested solution I have to navigate to Download File URL, But as per scenario I have to click on the Link after that file should get download. its mandatory to click on the button/Link and then verify the downloaded file I am able to set download path in Chrome, IE and Firefox but I need help to set it in edge Chromium browser. 

On Thursday, June 25, 2020 at 1:39:42 PM UTC+5:30, Mark Collin wrote:
Have a read of this:

<a href="https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fardesco.lazerycode.com%2Ftesting%2Fwebdriver%2F2012%2F07%2F25%2Fhow-to-download-files-with-selenium-and-why-you-shouldnt.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5kQSN7yU3CqwXEZabRtzvWRR2cA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fardesco.lazerycode.com%2Ftesting%2Fwebdriver%2F2012%2F07%2F25%2Fhow-to-download-files-with-selenium-and-why-you-shouldnt.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5kQSN7yU3CqwXEZabRtzvWRR2cA&#39;;return true;">https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html

On Thursday, 25 June 2020 07:53:07 UTC+1, Sagar Gulhane wrote:
I am using selenium 3.141 with C# I would like to set the download path using EdgeOptions. Please any one can help me with this. 

Current code I am using as below which is not working need to know the correct capabilities to add for Edge driver

  EdgeOptions edgeOptions = new EdgeOptions();
                edgeOptions.AddAdditionalCapability("download.default_directory", {Path});
                edgeOptions.AddAdditionalCapability("download.prompt_for_download", "false");

                driver = new EdgeDriver(edgeOptions);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0486842f-7db9-441b-9099-49a9f25cc9eao%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to set download path for EdgeDriver using EdgeOptions

Mark Collin-2
The question you need to ask yourself is this:

How would we fix the issue if the file exists and can be downloaded (Something you can check using the principles outlined in that log entry), but clicking on the button to download it doesn't work?

The answer is that you can't, you are testing browser functionality.  You cannot fix a browser bug and release a new version of the browser.  Even if you could, you can't force your user to use the new updated version of the browser.

By all means check that the file is there and can be downloaded, however don't waste your time trying to test browser functionality that you have no control over.

On Thursday, 25 June 2020 18:53:44 UTC+1, Sagar Gulhane wrote:
Thanks Mark,

For suggested solution I have to navigate to Download File URL, But as per scenario I have to click on the Link after that file should get download. its mandatory to click on the button/Link and then verify the downloaded file I am able to set download path in Chrome, IE and Firefox but I need help to set it in edge Chromium browser. 

On Thursday, June 25, 2020 at 1:39:42 PM UTC+5:30, Mark Collin wrote:
Have a read of this:

<a href="https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fardesco.lazerycode.com%2Ftesting%2Fwebdriver%2F2012%2F07%2F25%2Fhow-to-download-files-with-selenium-and-why-you-shouldnt.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5kQSN7yU3CqwXEZabRtzvWRR2cA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fardesco.lazerycode.com%2Ftesting%2Fwebdriver%2F2012%2F07%2F25%2Fhow-to-download-files-with-selenium-and-why-you-shouldnt.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5kQSN7yU3CqwXEZabRtzvWRR2cA&#39;;return true;">https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html

On Thursday, 25 June 2020 07:53:07 UTC+1, Sagar Gulhane wrote:
I am using selenium 3.141 with C# I would like to set the download path using EdgeOptions. Please any one can help me with this. 

Current code I am using as below which is not working need to know the correct capabilities to add for Edge driver

  EdgeOptions edgeOptions = new EdgeOptions();
                edgeOptions.AddAdditionalCapability("download.default_directory", {Path});
                edgeOptions.AddAdditionalCapability("download.prompt_for_download", "false");

                driver = new EdgeDriver(edgeOptions);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/01d4ea79-3c5d-4730-a1b8-620d7d1fc4c5o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to set download path for EdgeDriver using EdgeOptions

mr. Selenide

вт, 30 июн. 2020 г., 12:10 Mark Collin <[hidden email]>:
The question you need to ask yourself is this:

How would we fix the issue if the file exists and can be downloaded (Something you can check using the principles outlined in that log entry), but clicking on the button to download it doesn't work?

The answer is that you can't, you are testing browser functionality.  You cannot fix a browser bug and release a new version of the browser.  Even if you could, you can't force your user to use the new updated version of the browser.

By all means check that the file is there and can be downloaded, however don't waste your time trying to test browser functionality that you have no control over.

On Thursday, 25 June 2020 18:53:44 UTC+1, Sagar Gulhane wrote:
Thanks Mark,

For suggested solution I have to navigate to Download File URL, But as per scenario I have to click on the Link after that file should get download. its mandatory to click on the button/Link and then verify the downloaded file I am able to set download path in Chrome, IE and Firefox but I need help to set it in edge Chromium browser. 

On Thursday, June 25, 2020 at 1:39:42 PM UTC+5:30, Mark Collin wrote:
Have a read of this:

https://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html

On Thursday, 25 June 2020 07:53:07 UTC+1, Sagar Gulhane wrote:
I am using selenium 3.141 with C# I would like to set the download path using EdgeOptions. Please any one can help me with this. 

Current code I am using as below which is not working need to know the correct capabilities to add for Edge driver

  EdgeOptions edgeOptions = new EdgeOptions();
                edgeOptions.AddAdditionalCapability("download.default_directory", {Path});
                edgeOptions.AddAdditionalCapability("download.prompt_for_download", "false");

                driver = new EdgeDriver(edgeOptions);

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/01d4ea79-3c5d-4730-a1b8-620d7d1fc4c5o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAE7WSaHNZ_8qVKiy%2BL7TFEiKAntb-bv8eKJgOG%2BTCVp02pGwcA%40mail.gmail.com.