Skip to content

Commit fbef19e

Browse files
authored
docs: use Browser constants for browser name (#10567)
[skip ci]
1 parent 70f8326 commit fbef19e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

javascript/node/selenium-webdriver/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ The sample below and others are included in the `example` directory. You may
3333
also find the tests for selenium-webdriver informative.
3434

3535
```javascript
36-
const {Builder, By, Key, until} = require('selenium-webdriver');
36+
const {Builder, Browser, By, Key, until} = require('selenium-webdriver');
3737

3838
(async function example() {
39-
let driver = await new Builder().forBrowser('firefox').build();
39+
let driver = await new Builder().forBrowser(Browser.FIREFOX).build();
4040
try {
4141
await driver.get('http://www.google.com/ncr');
4242
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
@@ -60,7 +60,7 @@ const chrome = require('selenium-webdriver/chrome');
6060
const firefox = require('selenium-webdriver/firefox');
6161

6262
let driver = new webdriver.Builder()
63-
.forBrowser('firefox')
63+
.forBrowser(webdriver.Browser.FIREFOX)
6464
.setChromeOptions(/* ... */)
6565
.setFirefoxOptions(/* ... */)
6666
.build();
@@ -99,7 +99,7 @@ API:
9999

100100
```javascript
101101
let driver = new webdriver.Builder()
102-
.forBrowser('firefox')
102+
.forBrowser(webdriver.Browser.FIREFOX)
103103
.usingServer('http://localhost:4444/wd/hub')
104104
.build();
105105
```

0 commit comments

Comments
 (0)