Last active
October 16, 2018 20:12
-
-
Save sauceaaron/422a74c7de70dafb1498f121a7fc07f2 to your computer and use it in GitHub Desktop.
Simple Python test using Selenium with Sauce Labs
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
| import os | |
| from selenium import webdriver | |
| sauce_url = 'https://ondemand.saucelabs.com/wd/hub' | |
| desired_capabilities = { | |
| 'name': 'simple python test', | |
| 'username': os.environ['SAUCE_USERNAME'], | |
| 'accessKey': os.environ['SAUCE_ACCESS_KEY'], | |
| 'platform': 'Windows 10', | |
| 'browserName': 'chrome', | |
| 'version': 'latest' | |
| } | |
| driver = webdriver.Remote(command_executor=sauce_url, desired_capabilities=desired_capabilities) | |
| driver.get('https://saucelabs.com') | |
| print(driver.title) | |
| assert 'Sauce Labs' in driver.title | |
| driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment