作者在 2016-04-27 14:30:08 发布以下内容
#-*- coding:UTF-8 -*-
import time,unittest
from selenium import webdriver
class TestRegistModel(unittest.TestCase):
def setUp(self):
global dr
dr = webdriver.Firefox()
dr.get("http://192.168.90.128/tinyshop/")
time.sleep(2)
dr.maximize_window()
def tearDown(self):
dr.quit()
def testRegist001(self):
#点击登录
dr.find_element_by_xpath(".//*[@id='header']/div[1]/div/ul/li[1]/a/b").click()
dr.find_element_by_xpath(".//*[@id='email']").send_keys("111@qq.com")
dr.find_element_by_xpath(".//*[@id='content']/div/div/div[2]/form/dl[2]/dd/input").send_keys("111111")
dr.find_element_by_xpath(".//*[@id='content']/div/div/div[2]/form/dl[4]/dd/input").click()
def testRegist002(self):
#点击登录
dr.find_element_by_xpath(".//*[@id='header']/div[1]/div/ul/li[1]/a/b").click()
dr.find_element_by_xpath(".//*[@id='email']").send_keys("1111@qq.com")
dr.find_element_by_xpath(".//*[@id='content']/div/div/div[2]/form/dl[2]/dd/input").send_keys("111111")
dr.find_element_by_xpath(".//*[@id='content']/div/div/div[2]/form/dl[4]/dd/input").click()
if __name__ == '__main__':
unittest.main()