当前位置:网站首页>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 | # GeneratedbySelenium IDE``import pytest``importtime``import json``fromselenium import webdriver``fromselenium.webdriver.common.``byimportBy``fromselenium.webdriver.common.action_chains import ActionChains``fromselenium.webdriver.support import expected_conditions``fromselenium.webdriver.support.wait import WebDriverWait``fromselenium.webdriver.common.keys import Keys``fromselenium.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)的功能来管理测试用例

边栏推荐
猜你喜欢

抓住金三银四的尾巴,解锁程序员面试《刷题神器》

C#控件 ToolStripProgressBar 用法

使用CompletableFuture进行异步处理业务

IDEA can't find the Database solution

EXCEL如何快速拆分合并单元格数据

ICML2022 | Fully Granular Self-Semantic Propagation for Self-Supervised Graph Representation Learning

golang-gin-pprof-使用以及安全问题

技能大赛训练题:ftp 服务攻防与加固

技能大赛训练题:MS15_034漏洞验证与安全加固

浏览器被hao360劫持解决办法
随机推荐
生产力工具和插件
报错IDEA Terminated with exit code 1
DELL SC compellent 康贝存储系统怎么抓取配置信息
How IDEA runs web programs
Error: npm ERR code EPERM
Edge Cloud Explained in Simple Depth | 4. Lifecycle Management
ECCV 2022 | Robotic Interaction Perception and Object Manipulation
Selenium自动化测试之Selenium IDE
The use of C# control CheckBox
Flutter keyboard visibility
IDEA版Postman插件Restful Fast Request,细节到位,功能好用
selenium被反爬了怎么办?
Solution for browser hijacking by hao360
TensorRT安装及使用教程「建议收藏」
0X7FFFFFFF,0X80000000「建议收藏」
LeetCode·304竞赛·6132·使数组中所有元素都等于零·模拟·哈希
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
分布式锁有哪些,怎么实现(分布式锁的三种实现的对比)
VU 非父子组件通信
如何使用StarUML画类图[通俗易懂]