Selenium Concepts: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 3: | Line 3: | ||
* [[Selenium#Subjects|Selenium]] | * [[Selenium#Subjects|Selenium]] | ||
=Selenium Architecture= | =TO REFACTOR= | ||
==Selenium Architecture== | |||
Selenium has a client-server architecture, and includes both [[#Client|client]] and [[#Server|server]] components. | Selenium has a client-server architecture, and includes both [[#Client|client]] and [[#Server|server]] components. | ||
[[Image:Selenium_Testing_from_Java.png]] | [[Image:Selenium_Testing_from_Java.png]] | ||
==Client== | |||
=Client= | |||
The Selenium client exposes the WebDriver API, which can be used to interact with the page. The client extends RemoteWebDriver, which communicates with the [[#Server|remote Selenium server]]. There are browser-specific constructors for the WebDriver (ChromeDriver, FirefoxDriver). | The Selenium client exposes the WebDriver API, which can be used to interact with the page. The client extends RemoteWebDriver, which communicates with the [[#Server|remote Selenium server]]. There are browser-specific constructors for the WebDriver (ChromeDriver, FirefoxDriver). | ||
<font color=darkgray>There is still confusion on whether the client loads and uses a local driver or connects remotely to a server.</font> | <font color=darkgray>There is still confusion on whether the client loads and uses a local driver or connects remotely to a server.</font> | ||
==Server== | |||
=Server= | |||
The Selenium server receives request from the [[#Client|Selenium client]]'s RemoteWebDriver. | The Selenium server receives request from the [[#Client|Selenium client]]'s RemoteWebDriver. | ||
It also includes WebDriver API to run tests against web browsers on the server machine. | It also includes WebDriver API to run tests against web browsers on the server machine. | ||
==Navigation to a Web Page== | |||
=Navigation to a Web Page= | |||
<syntaxhighlight lang='java'> | <syntaxhighlight lang='java'> | ||
WebDriver driver = new ChromeDriver(); | WebDriver driver = new ChromeDriver(); | ||
driver.get("http://example.com"); | driver.get("http://example.com"); | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 18:13, 28 May 2021
Internal
TO REFACTOR
Selenium Architecture
Selenium has a client-server architecture, and includes both client and server components.
Client
The Selenium client exposes the WebDriver API, which can be used to interact with the page. The client extends RemoteWebDriver, which communicates with the remote Selenium server. There are browser-specific constructors for the WebDriver (ChromeDriver, FirefoxDriver). There is still confusion on whether the client loads and uses a local driver or connects remotely to a server.
Server
The Selenium server receives request from the Selenium client's RemoteWebDriver. It also includes WebDriver API to run tests against web browsers on the server machine.
WebDriver driver = new ChromeDriver();
driver.get("http://example.com");