1:安装nosetests
Python 单元测试框架之Nose
http://blog.sina.com.cn/s/blog_65a8ab5d0101fihb.html
http://www.cnblogs.com/JeffreySun/archive/2009/12/04/1608900.html
备注:使用easy_install安装步骤
http://www.cnblogs.com/huangjacky/archive/2012/03/28/2421866.html
http://jingyan.baidu.com/article/b907e627e78fe146e7891c25.html
2:selenium+python自动化测试
http://www.cnblogs.com/candle806/archive/2013/06/04/3116989.html
参考文章:http://download.csdn.net/detail/haolongzhong/6940527
代码:
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,time from selenium import webdriver from selenium.webdriver.common.keys import Keys driver =webdriver.Firefox() driver.get("https://uuap.baidu.com/login") time.sleep(3) driver.maximize_window() driver.find_element_by_id("username").clear() driver.find_element_by_id("username").send_keys("duting") driver.find_element_by_id("username").send_keys(Keys.TAB) time.sleep(3) driver.find_element_by_id("password").send_keys("Sa13011027") driver.find_element_by_id("password").send_keys(Keys.ENTER) time.sleep(3)
每天多一点提高,给自己一些激励,开心生活,用编码来丰富我的生活,加油!
↖(^ω^)↗