Skip to content

Instantly share code, notes, and snippets.

@loa
Created August 15, 2014 10:22
Show Gist options
  • Save loa/e3f15ee2f433ce4d29c1 to your computer and use it in GitHub Desktop.
Save loa/e3f15ee2f433ce4d29c1 to your computer and use it in GitHub Desktop.
Selenium Webdriver - Smoke test
#!/usr/bin/env python
from selenium import webdriver
import unittest
import sys
class ExampleTestCase(unittest.TestCase):
hub_address="http://selenium:4444"
def setUp(self):
desired_cap = webdriver.DesiredCapabilities.FIREFOX
desired_cap['platform'] = 'LINUX'
self.driver = webdriver.Remote("%s/wd/hub" % self.hub_address, desired_cap)
def test_grid_overview(self):
self.driver.get("%s/grid/console" % self.hub_address)
self.assertEqual(self.driver.title, "Grid Console")
def test_google(self):
self.driver.get("http://google.com")
self.assertEqual(self.driver.title, "Google")
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment