Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Javascript Example to Selenium Manager #1968

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from
34 changes: 34 additions & 0 deletions examples/javascript/test/selenium_manager/usage.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const Chrome = require('selenium-webdriver/chrome');
const {Browser, Builder} = require("selenium-webdriver");
const {getBinaryPaths} = require("selenium-webdriver/common/driverFinder");
const options = new Chrome.Options();

describe('Usage Test', function () {
it('After Selenium Manager', async function () {

let driver = new Builder()
.forBrowser(Browser.CHROME)
.build();

await driver.get('https://www.selenium.dev/selenium/web/blank.html');
await driver.quit();
});

it('Before Selenium Manager', async function () {
let paths = getBinaryPaths(options)
let driverPath = paths.driverPath;
let browserPath = paths.browserPath;

options.setChromeBinaryPath(browserPath)

let service = new Chrome.ServiceBuilder().setPath(driverPath)

let driver = new Builder()
.forBrowser(Browser.CHROME)
.setChromeService(service)
.build();

await driver.get('https://www.selenium.dev/selenium/web/blank.html');
await driver.quit();
});
});
7 changes: 5 additions & 2 deletions website_and_docs/content/documentation/selenium_manager.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
{{% tab header="JavaScript" %}}
**Previously**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
7 changes: 5 additions & 2 deletions website_and_docs/content/documentation/selenium_manager.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
{{% tab header="JavaScript" %}}
**Previously**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
{{% tab header="JavaScript" %}}
**Previously**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
{{< tab header="Ruby" >}}
{{< badge-code >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-code >}}
{{% tab header="JavaScript" %}}
**Previously**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< badge-code >}}
Expand Down