02 2018 档案

摘要:读取txt文件内容信息 read():#读取整个文件信息 readline(): #读取一行数据信息 readlines():读取所有行的数据 read 读取效果 readline 读取效果 readline 读取效果 读取JSON文件 读取excel文件 阅读全文
posted @ 2018-02-27 15:02 藤上小冬瓜 阅读(306) 评论(0) 推荐(0)
摘要:get 方法用例 post方法用例 阅读全文
posted @ 2018-02-27 14:01 藤上小冬瓜 阅读(246) 评论(0) 推荐(0)
摘要:类和方法 name is jack and come from beijinghello 51zxw 例二: 例三 类的继承 Super的用法 涉及到多重继承 enter center Benter Aenter Baseleave Baseleave Aleave Bleave c 阅读全文
posted @ 2018-02-26 22:46 藤上小冬瓜 阅读(994) 评论(0) 推荐(0)
摘要:pag object 是自动化测试最佳模式测试之一,它主要体现在对界面交互细节的封装 优点: 减少代码重复,提高测试的可读性,提搞测试用例的可维护性。 阅读全文
posted @ 2018-02-26 21:33 藤上小冬瓜 阅读(159) 评论(0) 推荐(0)
摘要:常用定位方法有: id name class name tag name link text partial link text xpath css selctor 对应的方法: find_element_by_id("kw") find_element_by_name("name") find_e 阅读全文
posted @ 2018-02-26 19:56 藤上小冬瓜 阅读(880) 评论(0) 推荐(0)
摘要:import unittest #要引入unittest框架包 阅读全文
posted @ 2018-02-26 12:54 藤上小冬瓜 阅读(112) 评论(0) 推荐(0)
摘要:一、浏览器的最大化 #coding=utf-8 from selneium import wbedriver driver = wbedriver.Firefox() #将webdriver 的Firefox()值给driver dirver.get("http://www.baidu.com") 阅读全文
posted @ 2018-02-26 12:21 藤上小冬瓜 阅读(173) 评论(0) 推荐(0)
摘要:各个浏览器驱动下载地址: https://code.google.com/p/selenium/downloads/list 安装chrome浏览器驱动,解压得到chromdriver.exe放到环境变量path设置的目录下 我们已经将python27设置到了path,可直接放在python27目录 阅读全文
posted @ 2018-02-26 11:20 藤上小冬瓜 阅读(281) 评论(0) 推荐(0)
摘要:coding = utf -8 python2需要, python3已默认 from selenium import webdriver 导入selenium的webdriver包只有导入我们才能使用webdriver API driver = webdriver.Firefox() 将webdri 阅读全文
posted @ 2018-02-26 11:14 藤上小冬瓜 阅读(138) 评论(0) 推荐(0)
摘要:*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- 小结: 迭代器是可以记住遍历的位置的对象 迭代器对象从集合的第一个元素开始访问,直到所有的元素被访问结束,只能往前不能后退 迭代器满足两个条件:it 阅读全文
posted @ 2018-02-02 22:36 藤上小冬瓜 阅读(167) 评论(0) 推荐(0)
摘要:关于闭包: 1、有一个外部环境的变量 2、内部函数对外部作用域的引用(不是全局的) def outer(): x = 10#x是外部环境的一个变量 def inner():#inner内部函数,对外部的作用域一个引用,所以内部函数inner是闭包 print x return inner f = outer()#返回的是inner函数地址 f()#执行... 阅读全文
posted @ 2018-02-01 22:40 藤上小冬瓜 阅读(144) 评论(0) 推荐(0)