This question already has an answer here:
- Selenium: Point towards default Chrome session 2 answers
So I have google chrome already opened where I am doing my own work. I am trying to run a selenium chrome driver using the default configuration stored in my C:\\Users\\Himanshu Poddar\\AppData\\Local\\Google\\Chrome\\User Data
ddirectory. But when I am launching chrome using this default profile, my function never returns which I think is due to my another chrome window opened on which I am working. Because I can see an alert appearing on my working chrome window which says "chrome is controlled by test software".
Here is what I have tried
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("user-data-dir=C:\\Users\\Himanshu Poddar\\AppData\\Local\\Google\\Chrome\\User Data")
chrome_path = r"C:\Users\Himanshu Poddar\Desktop\chromedriver.exe"
# This never returns
wd = webdriver.Chrome(chrome_path, chrome_options=options)
The last executing statement webdriver.Chrome never return and prints this to the console
[5972:6048:0614/210846.434:ERROR:cache_util_win.cc(21)] Unable to move the cache: 0
[5972:6048:0614/210846.435:ERROR:cache_util.cc(141)] Unable to move cache folder C:\Users\Himanshu Poddar\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache to C:\Users\Himanshu Poddar\AppData\Local\Google\Chrome\User Data\ShaderCache\old_GPUCache_000
[5972:6048:0614/210846.435:ERROR:disk_cache.cc(185)] Unable to create cache
[5972:6048:0614/210846.435:ERROR:shader_disk_cache.cc(623)] Shader Cache Creation failed: -2
Opening in existing browser session.
What was expected :
A different instance of chrome to be running with the same default profile that is independent of my current chrome window on which I am working.
Any help would be highly appreciated. Note that I tried all suggestions that I was getting for this question and none of them worked for me.
EDIT : This issue is somewhat similar to mine but does not contains the solution to this problem.