

Option.addExtensions(new File("C:\\Users\\Avinash\\Downloads\\extension_3_5_0_0.crx"))

tProperty("", "C:\\Selenium\\chromedriver.exe") ĬhromeOptions option = new ChromeOptions() Step# 2: Give the path of the crx file to the addExtensions() methodįollowing sample program adds an extension at runtime. Go to then enter the link of the chrome extension in the download box then click on Get. crx file of the extensionįirst, you need to download the. Option.addExtensions(new File("Path to the crx file")) Steps to implement insertion of chrome extension at runtime using Selenium WebDriverīelow mentioned steps elaborate the insertion of chrome extensions using Selenium. ChromeOptions option = new ChromeOptions() How to add chrome extension at runtime using Selenium WebDriver?įollowing piece of code helps us to add the chrome extensions at runtime using Selenium WebDriver. I just explained How I took advantage of the availability of insertion of chrome extension in Selenium WebDriver. The scenario could be anything You can use this implementation whenever required. You can refer them for more info, here are their links available: After research, I found a document on official chromium site where the declaration was given. Hence, I didn’t find that Chrome extensions for VPN during test execution. We already know that WebDriver creates a new session each time it triggers the new browser. Now I had to execute the test cases to make sure that there are no breakpoints. Therefore, I thought to use Virtual Proxy Network (VPN) to bypass the connection, hence, I downloaded one chrome extension and captured the web elements, thus, by doing so, I finished writing the test cases.

Their insurance portal is restricted in our country hence, I was unable to access their website to capture the web elements to write the test cases. I got an assignment from one of the banking clients who is mainly based in North America. How did I come across this scenario to add the chrome extension during test execution? We use Chrome Options here too to add the chrome extensions. Today we are going to discuss the technique to add chrome extension in the browser at runtime using Selenium WebDriver. We knew that ChromeOptions is one of the upgraded class for Java to set the capabilities Since DesiredCapabilities have been deprecated in Java. We have discussed a lot about Desired capabilities, ChromeOptions and technique to set proxy in Selenium by using Chrome Options class.
