Last active
December 18, 2015 21:58
-
-
Save billtaichi/5850592 to your computer and use it in GitHub Desktop.
Set incognito mode on selenium webdriver.
(Extracted from a class)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def SetBrowserObj(self): | |
try: | |
if self.browserdriver.strip().upper() == "CHROME": | |
options = webdriver.chrome.options.Options() | |
options.add_argument("-incognito") | |
browser = webdriver.Chrome(chrome_options=options) | |
if self.browserdriver.strip().upper() == "FIREFOX": | |
browser = webdriver.Firefox() | |
self.driver = browser | |
except Exception as e: | |
self.log.error("****** Unable to load browser object error is: {0}".format(e.message)) | |
raise e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks