zoukankan      html  css  js  c++  java
  • python 进行web测试

    1:安装nosetests   

    Python 单元测试框架之Nose

    http://blog.sina.com.cn/s/blog_65a8ab5d0101fihb.html

    Python nose test framework 介绍

    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)
    



  • 相关阅读:
    数组(array)
    亲戚(relative)
    [ZJOI2016]小星星
    P4782 【模板】2-SAT 问题
    CF1065F Up and Down the Tree
    CF1065C Make It Equal
    CF1060F Shrinking Tree
    CF1060E Sergey and Subway(点分治)
    CF1060D Social Circles
    CF1060C Maximum Subrectangle
  • 原文地址:https://www.cnblogs.com/graceting/p/5034033.html
Copyright © 2011-2022 走看看