#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re
class Shiply(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(30)
self.base_url = "http://scoweb.sco.ca.gov/" #California UCP
self.verificationErrors = []
def test_shiply(self):
driver = self.driver
driver.get(self.base_url + "/UCP/")
driver.find_element_by_id("ctl00_ContentPlaceHolder1_txtLastName").clear()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_txtLastName").send_keys("YOUR_NAME")
driver.find_element_by_id("ctl00_ContentPlaceHolder1_btnSearch").click()
def is_element_present(self, how, what):
try: self.driver.find_element(by=how, value=what)
except NoSuchElementException, e: return False
return True
def tearDown(self):
self.driver.quit()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()