![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SELENIUM
抽风同学
本博客更倾向于个人笔记
展开
-
SeleniumGrid的学习
1.通过官网去下载2.下载完成后是一个Jar包,需要本有有java才能执行,通过java -jar来执行该文件。3.成功图样,相当于开启了个端口为4444的服务。...原创 2019-04-26 14:15:55 · 93 阅读 · 0 评论 -
Pytest生成html测试报告,ALLURE报告
首先老样子安装库pip install pytest-html示例代码from selenium import webdriverimport randomimport pytestimport timeclass Test_restart(object): @pytest.fixture(scope="function", autouse=True) ...原创 2019-08-22 09:38:17 · 1230 阅读 · 0 评论 -
Selenium+Python鼠标定位的小补充
通过鼠标操作来模拟点击某元素首先要导入包from selenium.webdriver.common.action_chains import ActionChains编写代码 el_login = dr.find_element_by_xpath(".//*[@id='dologin']") mouse = ActionChains(dr) mou...原创 2019-08-20 16:17:29 · 627 阅读 · 0 评论 -
CSS与XPATH定位的小Tips
CSS:可以指定表情属性[id=mask]指定标签内有 id的属性 且值为 mask进阶级可以这么写[id=enhttpblock] .enhttpbox [class='topborder']解释就是一个标签[id=enhttpblock]的后代,选一个类标签属性为enhttpbox的标签,再从他之后选一个类属性为topborder的标签。XPATH:绝对路径...原创 2019-03-05 16:47:23 · 223 阅读 · 0 评论 -
Selenium普通文件上传和AutoIT文件上传
https://blog.csdn.net/qq_32897143/article/details/82014603原创 2019-03-05 22:09:31 · 177 阅读 · 0 评论 -
Python搭建Selenium
下载selenium: https://pypi.org/project/selenium/下载下来的selenium是.whl后缀的文件,需要先安装wheel工具,命令如下。pip install wheel然后执行安装seleniumpip install 绝对路径\selenium-3.12.0-py2.py3-none-any.whl2. 检验selenium...原创 2019-03-05 14:57:02 · 212 阅读 · 0 评论 -
Selenium的基本操作(5)(下拉框,js下滚页面,显示等待,隐式等待)
package com.main;import java.util.ArrayList;import java.util.List;import java.util.Set;import java.util.concurrent.TimeUnit;import org.openqa.selenium.By;import org.openqa.selenium.Javascript...原创 2019-02-19 16:39:13 · 315 阅读 · 0 评论 -
Selenium的基本操作(4)(本地页面,鼠标动作,弹出框)
package com.main;import java.util.ArrayList;import java.util.List;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement...原创 2019-02-19 14:33:51 · 314 阅读 · 0 评论 -
Selenium的基本操作(3)(切换窗口和iframe)
package com.main;import java.util.ArrayList;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.sel...原创 2019-02-18 23:57:35 · 319 阅读 · 0 评论 -
Selenium的基本操作(2)(phantomjs,组元素)
package com.main;import java.io.File;import java.util.List;import org.openqa.selenium.By;import org.openqa.selenium.Dimension;import org.openqa.selenium.Keys;import org.openqa.selenium.Output...原创 2019-02-18 22:07:02 · 183 阅读 · 0 评论 -
Selenium的基本操作(1)(基本访问)
package com.main;import org.openqa.selenium.By;import org.openqa.selenium.Dimension;import org.openqa.selenium.Keys;import org.openqa.selenium.Point;import org.openqa.selenium.WebDriver;import...原创 2019-02-18 18:42:49 · 210 阅读 · 0 评论 -
Selenium的小本本
貌似提示出现提示框说权限不足的 算是alertdriver.switch_to.frame(0) #用frame的index来定位,第一个是0 试下 貌似frame可以用角标切换如果没有框架的话,试一下这个driver.find_element_by_xpath(”//button[text()='新增']“),有框架加一个driver.switch_to_frame(框架名...转载 2019-05-16 14:25:41 · 82 阅读 · 0 评论 -
Selenium中JS的使用(元素点击,元素样式,通过Xpath查找元素操作,JS返回值)
此文示例用的是Python语言在Python中selenium执行js很容易,它的执行函数就存在于WebDriver中,Java需要导入其他包。简单示例from selenium import webdriverimport randomimport pytestimport timeclass Test_restart(object): @pytest.fixtu...原创 2019-08-26 09:50:45 · 2953 阅读 · 0 评论