Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 72738a5

Browse files
slu-itAxel Schüssler
authored andcommitted
Documentation refactoring because of changes to the Browser Factories
1 parent f16b47e commit 72738a5

File tree

7 files changed

+100
-123
lines changed

7 files changed

+100
-123
lines changed

documentation/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [Getting Started](chapters/gettingstarted.md)
66
- [Browser](chapters/browser.md)
7+
- [Browser Factories](chapters/browser-factories.md)
78
- [Configuration](chapters/configuration.md)
89
- [Event System](chapters/event-system.md)
910
- [Pages](chapters/page.md)
@@ -28,12 +29,7 @@
2829
- Assertions
2930
- [AssertJ](chapters/support-assertj3.md)
3031
- [Hamcrest](chapters/support-hamcrest.md)
31-
- Browser
32-
- [Chrome](chapters/support-chrome.md)
33-
- [Firefox](chapters/support-firefox.md)
34-
- [Firefox (Marionette)](chapters/support-marionette.md)
35-
- [Internet Explorer](chapters/support-ie.md)
36-
- Testing
32+
- Test Runner
3733
- [JUnit 4.x](chapters/support-junit4.md)
3834
- [JUnit 5.x](chapters/support-junit5.md)
3935
- Integration
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[Home](../README.md)
2+
3+
# Browser Factories
4+
5+
A `BrowserFactory` creates an abstraction over the `Browser` initialization based on project-global settings.
6+
They are intended to allow easy browser initialization and encapsulation of the underlying configuration / initialization
7+
processes. Most projects implement their own factories according to their specific environment.
8+
In case you just want to get started, we provide factories for the most common browsers:
9+
10+
- `ChromeFactory`
11+
- `FirefoxFactory`
12+
- `MarionetteFactory` (new Firefox driver)
13+
- `InternetExplorerFactory`
14+
15+
All of these are provided by the `webtester-core` module, but need you to provide the corresponding Selenium `WebDriver` dependencies yourself.
16+
17+
## ProxyConfiguration
18+
19+
In order to configure a proxy you can either configure it manually when initializing the `WebDriver` or
20+
you can implement a `ProxyConfiguration` and provide it to the `BrowserFactory` before creating a `Browser` instance.
21+
22+
```java
23+
ProxyConfiguration pc = createProxyConfiguration();
24+
Browser browser = new FirefoxFactory().withProxyConfiguration(pc).createBrowser();
25+
```
26+
27+
28+
## ChromeFactory
29+
30+
This `BrowserFactory` uses the `selenium-chrome-driver` to create new Chrome `Browser` instances.
31+
32+
### Default Driver Configuration
33+
In order to optimize testing the following properties are set when creating a `WebDriver` using the `ChromeFactory`:
34+
35+
- Native events are disabled -> Selenium does not simulate human typing.
36+
- Untrusted certificates are always accepted.
37+
38+
### Additional Service Executable
39+
The 'ChromeDriver' needs an additional executable to communicate with a Chrome browser.
40+
It can be downloaded [here](https://sites.google.com/a/chromium.org/chromedriver/downloads).
41+
42+
The path to the executable must be declared as a system or environment property named: `webdriver.chrome.driver`
43+
44+
**Additional Information:**
45+
- https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver
46+
47+
48+
## FirefoxFactory and MarionetteFactory
49+
50+
These `BrowserFactory` implementations use the `selenium-firefox-driver` to create new Firefox `Browser` instances.
51+
To drive Firefox browsers up to version 46, the `FirefoxFactory` *can* be used.
52+
In order to drive newer versions (47++), the `MarionetteFactory` *must* be used.
53+
The only real difference between these two factories is the activation of the `marionnette` capability.
54+
55+
### Default Driver Configuration
56+
In order to optimize testing the following properties are set when creating a `WebDriver` using the `FirefoxFactory`:
57+
58+
- Native events are disabled -> Selenium does not simulate human typing.
59+
- Untrusted certificates are always accepted.
60+
61+
### Additional Service Executable
62+
63+
Using the Marionette-activated `WebDriver` will force you to also specify the location of a `GeckoDriver` instance.
64+
This is basically a proxy between Selenium and the actual Firefox (like with the `ChromeDriver`).
65+
it can be downloaded [here](https://github.com/mozilla/geckodriver/releases)
66+
67+
The path to the executable must be declared as a system or environment property named: `webdriver.gecko.driver`
68+
69+
**Additional Information:**
70+
- https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver
71+
- https://github.com/mozilla/geckodriver
72+
- https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette
73+
74+
75+
## InternetExplorerFactory
76+
77+
This `BrowserFactory` uses the `selenium-ie-driver` to create new Internet Explorer `Browser` instances.
78+
79+
### Default Driver Configuration
80+
In order to optimize testing the following properties are set when creating a `WebDriver` using the `InternetExplorerFactory`:
81+
82+
- Native events are disabled -> Selenium does not simulate human typing.
83+
- Untrusted certificates are always accepted.
84+
85+
### Additional Service Executable
86+
The `InternetExplorerDriver` needs an additional executable to communicate with a IE browser.
87+
It can be downloaded [here](http://selenium-release.storage.googleapis.com/index.html).
88+
89+
The path to the executable must be declared as a system or environment property named: `webdriver.ie.driver`
90+
91+
**Additional Information:**
92+
- https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
93+
94+
# Linked Documentation
95+
96+
- [Browser](browser.md)
97+

documentation/chapters/browser.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,6 @@ It is the main entry point to the framework.
1414
A `BrowserBuilder` provides a builder API for initializing `Browser` instances and setting custom service implementations
1515
like the [`Configuration`](configuration.md).
1616

17-
**BrowserFactory:**
18-
A `BrowserFactory` creates an abstraction over the `Browser` initialisation based on project-global settings.
19-
They are intended to allow easy browser initialization and encapsulation of the underlying configuration / initialization
20-
processes.
21-
22-
**Provided default BrowserFactory implementations:**
23-
24-
- [`ChromeFactory`](support-chrome.md)
25-
- [`FirefoxFactory`](support-firefox.md)
26-
- [`MarionetteFactory`](support-marionette.md)
27-
- [`InternetExplorerFactory`](support-ie.md)
28-
29-
Each of them comes in their own support module. The Firefox's and Internet Explorer's factory implementations are optimized
30-
for performance.
31-
32-
**ProxyConfiguration:**
33-
In order to configure a proxy you can either configure it manually when initializing the `WebDriver` or
34-
you can implement a `ProxyConfiguration` and provide it to the `BrowserFactory` before creating a `Browser` instance.
35-
36-
```java
37-
ProxyConfiguration pc = createProxyConfiguration();
38-
Browser browser = new FirefoxFactory().withProxyConfiguration(pc).createBrowser();
39-
```
40-
4117
## The Web Driver Browser
4218
The `WebDriverBrowser` class implements `Browser` and is used to wrap a Selenium `WebDriver`.
4319
Instances can be created by using the `WebDriverBrowser's` factory methods:
@@ -74,6 +50,4 @@ Browser browser = new WebDriverBrowserBuilder(webDriver)
7450
# Linked Documentation
7551

7652
- [Configuration](configuration.md)
77-
- [Chrome Support](support-chrome.md)
78-
- [Firefox Support](support-firefox.md)
79-
- [Internet Explorer Support](support-ie.md)
53+
- [Browser Factories](browser-factories.md)

documentation/chapters/support-chrome.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

documentation/chapters/support-firefox.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

documentation/chapters/support-ie.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

documentation/chapters/support-marionette.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)