Skip to content

Commit 6319f71

Browse files
harsha509manoj9788
authored andcommitted
Modify: Removed awaits for findElement (JavaScript) (SeleniumHQ#136)
* Modify: Removing await for findElement as findElement returns a resolved promise internally Signed-off-by: Sri Harsha <sri_harsha509@hotmail.com> * Modify: Removed await for findElement (JavaScript) Signed-off-by: Sri Harsha <sri_harsha509@hotmail.com> * Modify: Removed unneccessary awaits for findElement (JavaScript) Signed-off-by: Sri Harsha <sri_harsha509@hotmail.com>
1 parent 48751dc commit 6319f71

24 files changed

+48
-48
lines changed

docs_source_files/content/webdriver/keyboard.de.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
338338
await driver.get('https://www.google.com');
339339

340340
// Store google search box WebElement
341-
let search = await driver.findElement(By.name('q'));
341+
let search = driver.findElement(By.name('q'));
342342

343343
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
344344
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
333333
await driver.get('https://www.google.com');
334334

335335
// Store google search box WebElement
336-
let search = await driver.findElement(By.name('q'));
336+
let search = driver.findElement(By.name('q'));
337337

338338
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
339339
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.es.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
339339
await driver.get('https://www.google.com');
340340

341341
// Store google search box WebElement
342-
let search = await driver.findElement(By.name('q'));
342+
let search = driver.findElement(By.name('q'));
343343

344344
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
345345
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
339339
await driver.get('https://www.google.com');
340340

341341
// Store google search box WebElement
342-
let search = await driver.findElement(By.name('q'));
342+
let search = driver.findElement(By.name('q'));
343343

344344
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
345345
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
338338
await driver.get('https://www.google.com');
339339

340340
// Store google search box WebElement
341-
let search = await driver.findElement(By.name('q'));
341+
let search = driver.findElement(By.name('q'));
342342

343343
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
344344
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.ko.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
339339
await driver.get('https://www.google.com');
340340

341341
// Store google search box WebElement
342-
let search = await driver.findElement(By.name('q'));
342+
let search = driver.findElement(By.name('q'));
343343

344344
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
345345
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.nl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
339339
await driver.get('https://www.google.com');
340340

341341
// Store google search box WebElement
342-
let search = await driver.findElement(By.name('q'));
342+
let search = driver.findElement(By.name('q'));
343343

344344
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
345345
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/keyboard.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ const {Builder, By, Key} = require('selenium-webdriver');
339339
await driver.get('https://www.google.com');
340340

341341
// Store google search box WebElement
342-
let search = await driver.findElement(By.name('q'));
342+
let search = driver.findElement(By.name('q'));
343343

344344
// Enters text "qwerty" with keyDown SHIFT key and after keyUp SHIFT key (QWERTYqwerty)
345345
await driver.actions().click(search).keyDown(Key.SHIFT).sendKeys("qwerty").keyUp(Key.SHIFT).sendKeys("qwerty").perform();

docs_source_files/content/webdriver/waits.de.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ end
7676
{{< / code-panel >}}
7777
{{< code-panel language="javascript" >}}
7878
await driver.get('file:///race_condition.html');
79-
const element = await driver.findElement(By.css('p'));
79+
const element = driver.findElement(By.css('p'));
8080
assert.strictEqual(await element.getText(), 'Hello from JavaScript!');
8181
{{< / code-panel >}}
8282
{{< code-panel language="kotlin" >}}
@@ -197,7 +197,7 @@ const documentInitialised = () =>
197197

198198
await driver.get('file:///race_condition.html');
199199
await driver.wait(() => documentInitialised(), 10000);
200-
const element = await driver.findElement(By.css('p'));
200+
const element = driver.findElement(By.css('p'));
201201
assert.strictEqual(await element.getText(), 'Hello from JavaScript!');
202202
{{< / code-panel >}}
203203
{{< code-panel language="kotlin" >}}
@@ -410,7 +410,7 @@ await driver.manage().setTimeouts( { implicit: 10000 } );
410410
// Navigate to url
411411
await driver.get('http://somedomain/url_that_delays_loading');
412412

413-
let webElement = await driver.findElement(By.id("myDynamicElement"));
413+
let webElement = driver.findElement(By.id("myDynamicElement"));
414414

415415
}());
416416
{{< / code-panel >}}

docs_source_files/content/webdriver/waits.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ end
7171
{{< / code-panel >}}
7272
{{< code-panel language="javascript" >}}
7373
await driver.get('file:///race_condition.html');
74-
const element = await driver.findElement(By.css('p'));
74+
const element = driver.findElement(By.css('p'));
7575
assert.strictEqual(await element.getText(), 'Hello from JavaScript!');
7676
{{< / code-panel >}}
7777
{{< code-panel language="kotlin" >}}
@@ -192,7 +192,7 @@ const documentInitialised = () =>
192192

193193
await driver.get('file:///race_condition.html');
194194
await driver.wait(() => documentInitialised(), 10000);
195-
const element = await driver.findElement(By.css('p'));
195+
const element = driver.findElement(By.css('p'));
196196
assert.strictEqual(await element.getText(), 'Hello from JavaScript!');
197197
{{< / code-panel >}}
198198
{{< code-panel language="kotlin" >}}
@@ -405,7 +405,7 @@ await driver.manage().setTimeouts( { implicit: 10000 } );
405405
// Navigate to url
406406
await driver.get('http://somedomain/url_that_delays_loading');
407407

408-
let webElement = await driver.findElement(By.id("myDynamicElement"));
408+
let webElement = driver.findElement(By.id("myDynamicElement"));
409409

410410
}());
411411
{{< / code-panel >}}

0 commit comments

Comments
 (0)