We are doing some testing using selenium python webdriver where we need to open one url in incognito mode and enable one extension already installed and then do some actions.
My findings:
- loading of extension in incognito mode not working
- extension getting loaded when icgnito mode turned off
Verified so many post on stack overflow, nothing worked. tried below code"
path = os.path.dirname(r"C:\Users\ab\AppData\Local\Google\Chrome\User Data\Default\Extensions\jfpmbokkdeapjommajdfmmheiiakdlgo\0.1.7_0\manifest.json")
options = webdriver.ChromeOptions()
options.add_argument('--incognito')
options.add_argument("--load-extension={path}")
driver = webdriver.Chrome(chrome_options=options, executable_path='C:\chromedriver_win32\chromedriver.exe')
driver.maximize_window()
driver.get(xxxxxxxx)
which throwing error cannot load manifest.json either missing or not readable. However i have made sure the path is correct.
any suggestion please how to load extension while opening chrome driver in incognito mode ?