Skip to content

Commit 62da9a4

Browse files
committed
Added Javascript Example to Selenium Manager
1 parent e1fa2da commit 62da9a4

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const Chrome = require('selenium-webdriver/chrome');
2+
const {Browser, Builder} = require("selenium-webdriver");
3+
const {getBinaryPaths} = require("selenium-webdriver/common/driverFinder");
4+
const options = new Chrome.Options();
5+
6+
describe('Usage Test', function () {
7+
it('After Selenium Manager', async function () {
8+
9+
let driver = new Builder()
10+
.forBrowser(Browser.CHROME)
11+
.build();
12+
13+
await driver.get('https://www.selenium.dev/selenium/web/blank.html');
14+
await driver.quit();
15+
});
16+
17+
it('Before Selenium Manager', async function () {
18+
let paths = getBinaryPaths(options)
19+
let driverPath = paths.driverPath;
20+
let browserPath = paths.browserPath;
21+
22+
options.setChromeBinaryPath(browserPath)
23+
24+
let service = new Chrome.ServiceBuilder().setPath(driverPath)
25+
26+
let driver = new Builder()
27+
.forBrowser(Browser.CHROME)
28+
.setChromeService(service)
29+
.build();
30+
31+
await driver.get('https://www.selenium.dev/selenium/web/blank.html');
32+
await driver.quit();
33+
});
34+
});

website_and_docs/content/documentation/selenium_manager.en.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
227227
{{< tab header="Ruby" >}}
228228
{{< badge-code >}}
229229
{{< /tab >}}
230-
{{< tab header="JavaScript" >}}
231-
{{< badge-code >}}
230+
{{% tab header="JavaScript" %}}
231+
**Previously**
232+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
233+
**Selenium Manager**
234+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
232235
{{< /tab >}}
233236
{{< tab header="Kotlin" >}}
234237
{{< badge-code >}}

website_and_docs/content/documentation/selenium_manager.ja.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
227227
{{< tab header="Ruby" >}}
228228
{{< badge-code >}}
229229
{{< /tab >}}
230-
{{< tab header="JavaScript" >}}
231-
{{< badge-code >}}
230+
{{% tab header="JavaScript" %}}
231+
**Previously**
232+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
233+
**Selenium Manager**
234+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
232235
{{< /tab >}}
233236
{{< tab header="Kotlin" >}}
234237
{{< badge-code >}}

website_and_docs/content/documentation/selenium_manager.pt-br.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
227227
{{< tab header="Ruby" >}}
228228
{{< badge-code >}}
229229
{{< /tab >}}
230-
{{< tab header="JavaScript" >}}
231-
{{< badge-code >}}
230+
{{% tab header="JavaScript" %}}
231+
**Previously**
232+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
233+
**Selenium Manager**
234+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
232235
{{< /tab >}}
233236
{{< tab header="Kotlin" >}}
234237
{{< badge-code >}}

website_and_docs/content/documentation/selenium_manager.zh-cn.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
227227
{{< tab header="Ruby" >}}
228228
{{< badge-code >}}
229229
{{< /tab >}}
230-
{{< tab header="JavaScript" >}}
231-
{{< badge-code >}}
230+
{{% tab header="JavaScript" %}}
231+
**Previously**
232+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
233+
**Selenium Manager**
234+
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
232235
{{< /tab >}}
233236
{{< tab header="Kotlin" >}}
234237
{{< badge-code >}}

0 commit comments

Comments
 (0)