# -*- coding:utf-8 -*- ''' @project: web学习 @author: Jimmy @file: find_ele.py @ide: PyCharm Community Edition @time: 2019-01-18 10:56 @blog: https://www.cnblogs.com/gotesting/ ''' from selenium import webdriver from selenium.webdriver.common.by import…
# -*- coding:utf-8 -*- ''' @project: web学习 @author: Jimmy @file: wait.py @ide: PyCharm Community Edition @time: 2019-01-19 09:50 @blog: https://www.cnblogs.com/gotesting/ ''' from selenium import webdriver import time driver = webdriver.Chrome() driv…
# -*- coding:utf-8 -*- ''' @project: web学习 @author: Jimmy @file: 元素操作-切换.py @ide: PyCharm Community Edition @time: 2019-01-19 10:43 @blog: https://www.cnblogs.com/gotesting/ ''' ''' windows窗口切换:切换到要操作的窗口 有多个窗口 1. 触发新窗口的出现 2. 得知道新窗口是谁 -- 依据窗口的window_h…
# -*- coding:utf-8 -*- ''' @project: web学习 @author: Jimmy @file: 鼠标操作.py @ide: PyCharm Community Edition @time: 2019-01-22 11:15 @blog: https://www.cnblogs.com/gotesting/ ''' from selenium import webdriver from selenium.webdriver.common.action_chains…
Python Web自动化测试入门与实战 购买地址 · 京东:https://item.jd.com/69239480564.html   天猫:https://detail.tmall.com/item.htm?spm=a220m.1000858.1000725.81.7d717628N0mje4&id=618358182656&skuId=4611686636785570560&user_id=2780997294&cat_id=2&is_b=1&rn=…
功能测试使用selenium,模块有: 1.futil: 公共方法,如元素高亮显示 # coding=utf-8 """高亮显示元素""" def highLight(driver,element): js = ''' element = arguments[0]; element.setAttribute('style','border: 3px solid red;') ''' driver.execute_script(js,element…
接口公共方法有:数据引擎.http引擎.Excel引擎 1.数据引擎:获取用例.结果检查.结果统计 # -*- coding:utf-8 -*- from XlsEngine import XlsEngine_rd import os '''获取用例''' def getCase(): filepath = os.path.abspath('.') filename = filepath + "/interfacetest/Data/InterfaceData.xlsx" data =…
常见自动化动作支持 click sendKeys swipe touch action 元素操作 1.click()点击操作 也可以用tab实现点击操作 driver.find_element_by_id("com.wuba.zhuanzhuan:id/ae8").click() 2.clear()清空输入框内容 driver.find_element_by_id("com.wuba.zhuanzhuan:id/ij").clear() 3.send(xx)输入框内…
测试用例基类: # coding=utf-8 import unittest import Logger log = Logger.Loger() class BaseCase(unittest.TestCase): def setUp(self): self.loginfo("============================================================") self.loginfo("%s is start" % sel…
Python接口测试采用python读取excel的方法,通过requests库发送请求和接收响应.模块有: Data:用于存放excel用例的,用例格式: iutil: 接口公共方法,数据引擎.http引擎.Excel引擎,见 http://www.cnblogs.com/fengsiyi/articles/7206855.html models: 一些接口对象的封装 report: 报告 testcases: 具体测试用例实现 Python web功能&接口自动化测试框架搭建——接口用例实现…