随笔分类 - python Selenium
python自动化测试
摘要:import imaplib import email import requests from selenium import webdriver import time url = "https://mail.google.com/mail/u/1/#search/" # res = reque
阅读全文
摘要:var a = [];$("nav a").each(function(){a.push($(this).attr("href"))});return a;
阅读全文
摘要:原理可以自行了解: 总的来说 ,就是主节点和子节点,主节点发送任务request到子节点上,子节点收到命令并且执行 那么怎么搭建这套环境呢,他们又是如何连接起来的呢 一、主节点hub 首先可以查看和selenium相关的镜像,找到我们需要启动的镜像 这里使用 docker search seleni
阅读全文
摘要:import os import openpyxl base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) test_data_path = os.path.join(base_path, "TestDatasX
阅读全文
摘要:滑动scroll: window.scrollTo(0,document.body.scrollHeight);
阅读全文
摘要:ddt:Class decorator for subclasses of ``unittest.TestCase``. ``unittest.testcase``子类的类修饰器。 ``unittest.testcase``子类的类修饰器。 ``unittest.testcase``子类的类修饰器。
阅读全文
摘要:1 from selenium import webdriver 2 mobile_emulation = {'deviceName':'iPhone X'} 3 options = webdriver.ChromeOptions() 4 options.add_experimental_option('mobileEmulation',mobile_emulation) 5 drivers =...
阅读全文
摘要:为了减小维护成本: 1.UI自动化测试需要有较为稳定的环境 2.代码设计合理,那么我们就需要面向对象的设计一个框架,将重复的代码模块化 一、首先总结一下 UI自动化大概要哪些模块 1.config(配置文件):用来存放配置文件(YML,XML,HTML。。。) 2.data(数据文件):存放测试数据
阅读全文
摘要:一、模拟手机打开页面(H5测试) 二、鼠标、键盘操作(只解释拖拽和Enter,其他需要自己补充) 三、starts-with、contains定位
阅读全文
摘要:一、Radio 判断radio是否已经被选中 1 driver.find_element_by_id().is_selected() 其返回值为bool类型,True or False 二、frame frame有三种frameset、frame、iframe,frameset跟其他普通标签没有区别
阅读全文