Aselenium前言

Selenium是一个浏览器自动化项目,包含一系列工具和库,支持跨浏览器的自动化测试。其核心组件WebDriver提供了一个接口,用于编写可在多种浏览器中运行的指令集。Selenium还提供了模拟用户与浏览器交互的功能,以及用于大规模分布式测试的基础设施。
https://www.seleniumhq.org/
THE SELENIUM BROWSER AUTOMATION PROJECT
Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers.
It provides extensions to emulate user interaction with browsers, a distribution server for scaling browser allocation, and the infrastructure for implementations of the W3C WebDriver specificationthat lets you write interchangeable code for all major web browsers.
This project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available for anyone to use, enjoy, and improve.
Selenium brings together browser vendors, engineers, and enthusiasts to further an open discussion around automation of the web platform. The project organises an annual conference to teach and nurture the community.
At the core of Selenium is WebDriver, an interface to write instruction sets that can be run interchangeably in many browsers. Here is one of the simplest instructions you can make:
from selenium import webdriver driver = webdriver.Firefox() driver.get("http://google.com/?hl=en") search_box = driver.find_element_by_name("q") search_box.send_keys("cheese") search_box.submit()
See the Quick Tour for a full explanation of what goes on behind the scenes when you run this code. You should continue on to the narrative documentation to understand how you can install and successfully use Selenium as a test automation tool, and scaling simple tests like this to run in large, distributed environments on multiple browsers, on several different operating systems.
 
SELENIUM浏览器自动化项目
Selenium是使用一系列工具和库支持Web浏览器自动化功能的综合项目。
它提供了模拟用户与浏览器交互的扩展,用于扩展浏览器分配的分发服务器,以及用于实现 W3C WebDriver规范的基础结构 ,可让您为所有主要Web浏览器编写可交互的代码。
这个项目由志愿者贡献者完成,他们已经投入了数千小时的时间,并且可以 让任何人免费使用源代码以供每个人使用、欣赏和改进。
Selenium将浏览器供应商,工程师和爱好者聚集在一起,围绕Web平台的自动化进一步开展讨论。该项目组织年度会议 来教育和培育社区。
Selenium的核心是WebDriver,它是一个编写指令集的接口,可以在许多浏览器中交替使用。这是您可以做出的最简单的指令之一:
from selenium import webdriver driver = webdriver.Firefox() driver.get("http://google.com/?hl=en") search_box = driver.find_element_by_name("q") search_box.send_keys("cheese") search_box.submit()
运行此代码时,请参阅快速浏览以了解幕后操作的完整说明。您应该继续阅读叙述文档, 以了解如何安装并成功使用Selenium作为测试自动化工具,并将这种简单的测试扩展为在多个浏览器上的大型分布式环境中,在多个不同的操作系统上运行。
 
 

转载于:https://www.cnblogs.com/TomBombadil/p/10975685.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值