selenium webdriver w/python learning

===========
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.htmlphp

相關文章
相關標籤/搜索