首页 > IT技术 > python > 正文

webdriver python 环境部署+lettuce和报告
2012-12-25 16:18:17   来源:   评论:0 点击:

python+webdriver的输出报告,常用api

 

======
install
===========
1.安装python2.7:
下载地址:http://python.org/getit/
下载后直接点击就可以安装
2.安装setuptools
下载地址:http://pypi.python.org/pypi/setuptools#downloads (下载后直接点击就可以安装)
3.安装pip
下载地址:http://pypi.python.org/pypi/pip/1.0.2#downloads
command: python setup.py install (pip.exe 存在于 \scripts\)
4.安装selenium:
command: pip install selenium (如果是更新selenium,则用:pip install selenium --upgrade)


========================
python unittest framework
========================
1.可在"Python Manual"中查找关键词字“unittest”获取 framework的相关知识:也可参考中文网址(http://www.oschina.net/question/12_27127#RUNNING_CMD)
 1).TestCase:
setUp()、tearDown()、test_*()
实例~~
2).TestSuite
addTest(testcase)
3).run test suite
a. if __name__ = "__main__": unittest.main()
b. unittest.TextTestRunner().run(suite)

================
selenium project
================
1. setup a webdriver project with python:
http://seleniumhq.org/docs/03_webdriver.html#setting-up-a-selenium-webdriver-project
http://readthedocs.org/docs/selenium-python/en/latest/navigating.html
 2. selenium API: http://selenium.googlecode.com/svn/trunk/docs/api/py/api.html
3. Q&A: http://stackoverflow.com/questions/8832858/selenium-webdriver-click-is-not-working-sometimes-in-python
 4. 代码解读: http://svn.openqa.org/fisheye/browse/selenium/selenium-website/src/main/rst/cn/05_selenium_rc.rst?r1=2630&r2=2632&u=384&ignore=&k=

5.CSS定位:http://saucelabs.com/blog/index.php/2009/10/selenium-tip-of-the-week-start-improving-your-locators/
                    http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#attribute-selectors
                    http://kb.cnblogs.com/page/53784/
 6. WebDriver API: http://readthedocs.org/docs/selenium-python/en/latest/api.html
7.lettuce相关资料 http://lettuce.it/index.html
8.py+webdriver学习指南:http://www.cnblogs.com/bluescorpio/archive/2012/05/13/2498211.html
原文地址:http://my.oschina.net/hcp/blog/40847

二:selenium webdriver测试报告
 1.1.下载HTMLTestRunner.py,将其放入 python目录\lib\ 下
 

相关热词搜索:webdriver python lettuce api

上一篇:selenium webdriver(python篇)学习(三)----unittest学习
下一篇:用python做测试--序

分享到: 收藏
评论排行