当前位置:网站首页>Selenium自动化测试之Selenium IDE
Selenium自动化测试之Selenium IDE
2022-07-31 13:41:00 【虚幻私塾】
优质资源分享
学习路线指引(点击解锁) | 知识定位 | 人群定位 |
---|---|---|
🧡 Python实战微信订餐小程序 🧡 | 进阶级 | 本课程是python flask+微信小程序的完美结合,从项目搭建到腾讯云部署上线,打造一个全栈订餐系统。 |
Python量化交易实战 | 入门级 | 手把手带你打造一个易扩展、更安全、效率更高的量化交易系统 |
简介
Selenium IDE 是实现Web自动化的一种便捷工具,本质上它是一种浏览器插件。该插件支持Chrome和Firefox浏览器,拥有录制、编写及回放操作等功能,能够快速实现Web的自动化测试
使用场景
- Selenium IDE本身的定位并不是用于复杂的自动化场景,而是用于一些对效率拥有极高要求的简易场景
- 用于发现BUG,重现BUG,提高沟通效率
- 提高用例执行效率,提高回归效率
- 录制功能可以导出代码,节省自动代码编写时间
安装:
- 打开火狐浏览器,搜索火狐插件
- 点击选中进入后进行安装
基本操作
点击图标进入
录制与回放
- 点击第一个选项我们录制一个新的项目
- 输入项目名称
- 输入需要录制的网址
- 跳转页面后在录制状态下进行页面操作
- 操作结束后暂停录制,状态显示如下
- 点击按钮进行回放
注意:上图右上角保存按钮可以用来保存录制脚本
7.
8. 可以导出脚本,节约编写用例的时间
| 123456789101112131415161718192021222324252627 | # Generated
by
Selenium IDE``import pytest``import
time``import json``from
selenium import webdriver``from
selenium.webdriver.common.``by
import
By``from
selenium.webdriver.common.action_chains import ActionChains``from
selenium.webdriver.support import expected_conditions``from
selenium.webdriver.support.wait import WebDriverWait``from
selenium.webdriver.common.keys import Keys``from
selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class TestFirsttest():``def setup_method(self, method):``self.driver = webdriver.Firefox()``self.vars = {}
def teardown_method(self, method):``self.driver.quit()
def test_firsttest(self):``self.driver.get(``"https://www.baidu.com/"``)``self.driver.set_window_size(1146, 693)``self.driver.find_element(``By``.ID,
"kw"``).click()``self.driver.find_element(``By``.ID,
"kw"``).send_keys(``"helloworld"``)``self.driver.find_element(``By``.ID,
"su"``).click()
|
测试套件
- 在同一个项目中,可以同时管理多条测试用例。在Selenium IDE的测试视图中单击“+”按钮,可以新增测试用例,也可以右击一条测试用例,在上下文菜单中选择Duplicate(复制)选项进行复制
- 如果每个模块都有几十条测试用例,那么这些用例在对应的面板下将非常难以维护,以至于根本无法分辨各个用例归属于哪个模块。Selenium IDE提供了一种名为“测试套件”(Test Suite)的功能来管理测试用例
边栏推荐
- DELL SC compellent 康贝存储系统怎么抓取配置信息
- C#使用ComboBox控件
- golang-gin - graceful restart
- AI cocoa AI frontier introduction (7.31)
- The use of C# control CheckBox
- 推荐系统-召回阶段-2013:DSSM(双塔模型)【Embedding(语义向量)召回】【微软】
- Text similarity calculation (Chinese and English) detailed explanation of actual combat
- C# 中的Async 和 Await 的用法详解
- C#控件 ToolStripProgressBar 用法
- The operator,
猜你喜欢
报错IDEA Terminated with exit code 1
Even if the image is missing in a large area, it can also be repaired realistically. The new model CM-GAN takes into account the global structure and texture details
Miller_Rabin 米勒拉宾概率筛【模板】
[CPU Design Practice] Simple Pipeline CPU Design
技能大赛训练题:登录安全加固
[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)
ECCV2022: Recursion on Transformer without adding parameters and less computation!
Spark学习:为Spark Sql添加自定义优化规则
ECCV 2022 | Robotic Interaction Perception and Object Manipulation
C# control StatusStrip use
随机推荐
模拟量差分和单端(iou计算方法)
Samba 远程命令执行漏洞(CVE-2017-7494)
IDEA can't find the Database solution
AI cocoa AI frontier introduction (7.31)
ECCV 2022 | 机器人的交互感知与物体操作
CLion用于STM32开发
ECCV2022: Recursion on Transformer without adding parameters and less computation!
SAP 电商云 Spartacus UI 和 Accelerator UI 里的 ASM 模块
ECCV2022:在Transformer上进行递归,不增参数,计算量还少!
4.爬虫之Scrapy框架2数据解析&配置参数&数据持久化&提高Scrapy效率
What should I do if selenium is reversed?
C#控件ListView用法
IDEA如何运行web程序
pytorch gpu版本安装最新
C#中+=的用法
拥塞控制,CDN,端到端
Use of C# Assembly
分布式锁有哪些,怎么实现(分布式锁的三种实现的对比)
浏览器被hao360劫持解决办法
Talk about the message display mechanism on the SAP product UI