TransWikia.com

How do I disable 'show all' download bar of chrome in selenium

Software Quality Assurance & Testing Asked by sreelakshmi on December 28, 2021

I need to disable ‘show all’ download bar of chrome in selenium.

Because the download bar is showing, UI elements in the lower portion of my page that need to be clicked are not visible.
I’m looking for something like the way we disable notification bars with

ChromeOptions options = new ChromeOptions(); 
options.addArguments("disable-infobars"); 

Is there a way to disable the download bar like this, and where can I find the information?

2 Answers

One way to solve this would be to set up a custom chrome profile in which you disable the download prompt, save it to a specific location inside your project, then use to pass as an argument to ChromeOptions.

var options = new ChromeOptions();
options.AddArgument("--profile-directory=AutoUser");
    or
options.AddArgument("--user-data-dir=C:/Users/YourUserName/AppData/Local/Google/Chrome/User Data");

Answered by Sorin D. on December 28, 2021

Best Approach would be to Use Actions class in this case. The Element you need to interact with after the download bar is visible will be accessible with Actions class methods such as moveToElement().

This will save you the hassle of switching tabs and is a more neat approach.

Answered by Kovid Mehta on December 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP