一凹蜈、簡介
Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers
selenium是一個(gè)能夠支持web瀏覽器自動化的工具和庫
...that uses the best techniques available to remotely control browser instances and emulate a user’s interaction with the browser.
可用于遠(yuǎn)程控制瀏覽器實(shí)例和模擬與瀏覽器用戶的交互涂乌。
It allows users to simulate common activities performed by end-users; entering text into fields, selecting drop-down values and checking boxes, and clicking links in documents. It also provides many other controls such as mouse movement, arbitrary JavaScript execution, and much more.
它允許用戶模擬終端用戶執(zhí)行的常見活動,輸入文本字段,選擇下拉值和檢查框....
Selenium supports automation of all the major browsers in the market through the use of?WebDriver. WebDriver is an API and protocol that defines a language-neutral interface for controlling the behaviour of web browsers. Each browser is backed by a specific WebDriver implementation, called a?driver. The driver is the component responsible for delegating down to the browser, and handles communication to and from Selenium and the browser.
Selenium通過使用WebDriver支持市場上所有主流瀏覽器的自動化傻丝。WebDriver 是一個(gè)定義了控制web瀏覽器的行為的API和協(xié)議层玲。每個(gè)瀏覽器都有一個(gè)支持的特定WebDriver接口實(shí)現(xiàn)的驅(qū)動。它可以負(fù)責(zé)操作瀏覽器處理瀏覽器和selenium之間的通信炮温。
二玄窝、Driver是什么
?Responsible for controlling the actual browser. Most drivers are created by the browser vendors themselves. Drivers are generally executable modules that run on the system with the browser itself, not on the system executing the test suite. (Although those may be the same system.) NOTE:?Some people refer to the drivers as proxies.
負(fù)責(zé)操作真實(shí)的瀏覽器。大多數(shù)的驅(qū)動是由瀏覽器廠商創(chuàng)造的械姻。驅(qū)動可以執(zhí)行運(yùn)行在瀏覽器本身的系統(tǒng)模塊妒蛇,而不是系統(tǒng)上執(zhí)行測試套件
三、原理
Communication: WebDriver passes commands to the browser through the driver, and receives information back via the same route.
如圖:WebDriver通過向驅(qū)動下達(dá)指令給瀏覽器楷拳。同樣的方式接收響應(yīng)信息
Communication to the browser may also be?remote?communication through Selenium Server or RemoteWebDriver. RemoteWebDriver runs on the same system as the driver and the browser.
WebDriver也可以通過selenium服務(wù)器向驅(qū)動下達(dá)指令給瀏覽器绣夺。同樣的方式接收響應(yīng)信息
The test framework is responsible for running and executing your WebDriver and related steps in your tests. As such, you can think of it looking akin to the following image.
測試框架負(fù)責(zé)運(yùn)行和執(zhí)行webdriver 如下圖
本文摘自https://www.selenium.dev/documentation,翻譯可參考但不保證翻譯的準(zhǔn)確性欢揖,英語好的大家自行翻譯或者查看原文檔