Last active
November 15, 2016 14:14
-
-
Save ujwalp1994/c86d7584b9008738a7bb98feec2dc8fa to your computer and use it in GitHub Desktop.
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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
import time | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.options import Options | |
***** FirefoxProfile to add extensions ********* | |
profile = webdriver.FirefoxProfile() | |
profile.add_extension('/Path to the extension.xpi') | |
profile.update_preferences() | |
desired_cap={ 'browser': 'Firefox', 'browser_version': '47.0', 'os': 'Windows', 'os_version': '7'} | |
******* Creating WebDriver instance ************ | |
driver = webdriver.Remote( | |
command_executor='http://<username>:<access_key>@hub.browserstack.com:80/wd/hub', | |
desired_capabilities=desired_cap, browser_profile=profile | |
) | |
************** Code Logic ******* | |
driver.get('http://www.google.com') | |
driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment