Disable Developer Mode Extensions Warning using Selenium

After Chrome’s new update, we are getting an extension warning pop-up, called Disable Developer Mode Extensions. This pop-up warning message is not like general pop-up which we can handle through Alert(), rather this is something different where we have to add some more lines in our code.

Let me tell you the nature of such extensions, it could be any legit warning message or anything which you have built by yourself or something suspicious in the form of malware. So you should be very careful about warning message from Chrome, like Disable Developer Mode Extensions. This pop-up message is quite un-natural for Selenium and it leads to failure of our test cases.

What is Developer Mode in Google Chrome?

As its name reflects, it will be something related to development activities.

Google Chrome has built-in facilities for debugging and customization. It allows the users and developers to customize as well as to trigger different operational changes to the browser. Google Chrome does not allow its users to download extensions from another web store, so the user may quickly add, modify, optimize and customize other’s extensions in Developer mode.

Why does browser pop-up Disable Developer Mode Extensions Warning?

Whenever any user downloads extensions from external sources then Chrome starts displaying disable developer mode extensions warning pop-up message. It injects such message for the sake of your information security only. It is a reminder to review all your external extensions download because it may harm your system which may lead to data theft.

Thus, users have two choices, either disable the warning message or cancel it. If you chose to disable then this warning pop-up message will no longer available to appear while each time you open browser, whereas, if you select cancel then it will be hidden for that session and will re-appear when you open chrome browser with a new session.

We can disable this pop-up manually, but today we will discuss to disable developer mode extensions warning pop-up by using Selenium with Java.

How to disable developer mode extensions pop-up in Selenium WebDriver?

In general, we create an instance of ChromeDriver after we set the system property. But, in this case, we create an instance of ChromeOptions and then we pass arguments for disabling developer mode extensions. Once it disables the pop-up then we define the instance of ChromeDriver for proceedings of the test cases.

Avinash Mishra

Avinash Mishra is the author of Inviul blog. He is a software engineer and blogger by choice. He loves to write blogs, and apart from blogging, he is interested in documentary film making, listening to music, traveling around the world and philanthropic activities.