This repository was archived by the owner on Nov 29, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 194
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
python chrome profiles #7412
Copy link
Copy link
Closed
Description
Originally reported on Google Code with ID 7412
I replace userName with my actual username in the below.
When using Firefox I do the following
fp = webdriver.FirefoxProfile('C:/Users/userName/AppData/Roaming/Mozilla/Firefox/Profiles/mkyhlgmr.default')
self.driver = webdriver.Firefox(fp)
and the behavior of the firefox browser is the same when I run my python Selenium scripts
as if I interact with the browser by hand.
I want to try the chrome browser and as expected it does not behave the same inside
the python scripts as when I go to web pages by hand. This is because it is not using
the same profile. I have not been able to find the syntax to do this in python. Below
is what I am using. Can someone please give me the syntax to pass the default profile
to python?
chromedriver = "C:/Anaconda/Scripts/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
str='C:/Users/userName/AppData/Local/Google/Chrome/User Data/Default'
chrome_options = Options()
chrome_options.add_argument("test-type")
chrome_options.add_argument("user-data dir=C:/Users/userName/AppData/Local/Google/Chrome/User
Data")
self.driver = webdriver.Chrome(executable_path=chromedriver,chrome_options=chrome_options)
Reported by john.nehrbass on 2014-05-29 20:49:50