Skip to content

Commit 96ab874

Browse files
harsha509manoj9788diemol
authored
Add: Python and JS code samples for Clear command in keyboard document (#216) [deploy site]
* Modify: Removed unneccessary awaits for find element Signed-off-by: Sri Harsha <[email protected]> * Add: Added ruby sample code for mouse actionsin support package Signed-off-by: Sri Harsha <[email protected]> * Modify: Revamping the WebElement usage document Signed-off-by: Sri Harsha <[email protected]> * Add: Adding findElements section to web_element document Signed-off-by: Sri Harsha <[email protected]> * Modify: Update to stale PR #111 Signed-off-by: Sri Harsha <[email protected]> * Modify: Removed desired capabilities and used FirefoxOptions in code sample Signed-off-by: Sri Harsha <[email protected]> * Modify: Translated[EN-FR] Introduction-> selenium_proj_and_tools Signed-off-by: Sri Harsha <[email protected]> * Modify: Translated[EN-FR] introduction-> types of testing Signed-off-by: Sri Harsha <[email protected]> * Fix: Updating text to bold Signed-off-by: Sri Harsha <[email protected]> * Add: [JS], [py] code sample for clear command in keyboard doc Co-authored-by: Manoj Kumar <[email protected]> Co-authored-by: Diego Molina <[email protected]>
1 parent d707fbf commit 96ab874

File tree

8 files changed

+214
-22
lines changed

8 files changed

+214
-22
lines changed

docs_source_files/content/webdriver/keyboard.de.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,16 @@ public class clear {
398398
}
399399
{{< / code-panel >}}
400400
{{< code-panel language="python" >}}
401-
# Please create a PR
401+
from selenium import webdriver
402+
driver = webdriver.Chrome()
403+
404+
# Navigate to url
405+
driver.get("http://www.google.com")
406+
# Store 'SearchInput' element
407+
SearchInput = driver.find_element_by_name("q")
408+
SearchInput.send_keys("selenium")
409+
# Clears the entered text
410+
SearchInput.clear()
402411
{{< / code-panel >}}
403412
{{< code-panel language="csharp" >}}
404413
// Please create a PR
@@ -407,7 +416,22 @@ public class clear {
407416
# Please create a PR
408417
{{< / code-panel >}}
409418
{{< code-panel language="javascript" >}}
410-
// Please create a PR
419+
const {Builder, By} = require('selenium-webdriver');
420+
(async function example() {
421+
let driver = await new Builder().forBrowser('chrome').build();
422+
try {
423+
// Navigate to Url
424+
await driver.get('https://www.google.com');
425+
// Store 'SearchInput' element
426+
let searchInput = driver.findElement(By.name('q'));
427+
await searchInput.sendKeys("selenium");
428+
// Clears the entered text
429+
await searchInput.clear();
430+
}
431+
finally {
432+
await driver.quit();
433+
}
434+
})();
411435
{{< / code-panel >}}
412436
{{< code-panel language="kotlin" >}}
413437
import org.openqa.selenium.By
@@ -427,4 +451,4 @@ fun main() {
427451
}
428452
}
429453
{{< / code-panel >}}
430-
{{< / code-tab >}}
454+
{{< / code-tab >}}

docs_source_files/content/webdriver/keyboard.en.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,16 @@ public class clear {
393393
}
394394
{{< / code-panel >}}
395395
{{< code-panel language="python" >}}
396-
# Please create a PR
396+
from selenium import webdriver
397+
driver = webdriver.Chrome()
398+
399+
# Navigate to url
400+
driver.get("http://www.google.com")
401+
# Store 'SearchInput' element
402+
SearchInput = driver.find_element_by_name("q")
403+
SearchInput.send_keys("selenium")
404+
# Clears the entered text
405+
SearchInput.clear()
397406
{{< / code-panel >}}
398407
{{< code-panel language="csharp" >}}
399408
// Please create a PR
@@ -402,7 +411,22 @@ public class clear {
402411
# Please create a PR
403412
{{< / code-panel >}}
404413
{{< code-panel language="javascript" >}}
405-
// Please create a PR
414+
const {Builder, By} = require('selenium-webdriver');
415+
(async function example() {
416+
let driver = await new Builder().forBrowser('chrome').build();
417+
try {
418+
// Navigate to Url
419+
await driver.get('https://www.google.com');
420+
// Store 'SearchInput' element
421+
let searchInput = driver.findElement(By.name('q'));
422+
await searchInput.sendKeys("selenium");
423+
// Clears the entered text
424+
await searchInput.clear();
425+
}
426+
finally {
427+
await driver.quit();
428+
}
429+
})();
406430
{{< / code-panel >}}
407431
{{< code-panel language="kotlin" >}}
408432
import org.openqa.selenium.By

docs_source_files/content/webdriver/keyboard.es.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,16 @@ public class clear {
399399
}
400400
{{< / code-panel >}}
401401
{{< code-panel language="python" >}}
402-
# Please create a PR
402+
from selenium import webdriver
403+
driver = webdriver.Chrome()
404+
405+
# Navigate to url
406+
driver.get("http://www.google.com")
407+
# Store 'SearchInput' element
408+
SearchInput = driver.find_element_by_name("q")
409+
SearchInput.send_keys("selenium")
410+
# Clears the entered text
411+
SearchInput.clear()
403412
{{< / code-panel >}}
404413
{{< code-panel language="csharp" >}}
405414
// Please create a PR
@@ -408,7 +417,22 @@ public class clear {
408417
# Please create a PR
409418
{{< / code-panel >}}
410419
{{< code-panel language="javascript" >}}
411-
// Please create a PR
420+
const {Builder, By} = require('selenium-webdriver');
421+
(async function example() {
422+
let driver = await new Builder().forBrowser('chrome').build();
423+
try {
424+
// Navigate to Url
425+
await driver.get('https://www.google.com');
426+
// Store 'SearchInput' element
427+
let searchInput = driver.findElement(By.name('q'));
428+
await searchInput.sendKeys("selenium");
429+
// Clears the entered text
430+
await searchInput.clear();
431+
}
432+
finally {
433+
await driver.quit();
434+
}
435+
})();
412436
{{< / code-panel >}}
413437
{{< code-panel language="kotlin" >}}
414438
import org.openqa.selenium.By

docs_source_files/content/webdriver/keyboard.fr.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,16 @@ public class clear {
399399
}
400400
{{< / code-panel >}}
401401
{{< code-panel language="python" >}}
402-
# Please create a PR
402+
from selenium import webdriver
403+
driver = webdriver.Chrome()
404+
405+
# Navigate to url
406+
driver.get("http://www.google.com")
407+
# Store 'SearchInput' element
408+
SearchInput = driver.find_element_by_name("q")
409+
SearchInput.send_keys("selenium")
410+
# Clears the entered text
411+
SearchInput.clear()
403412
{{< / code-panel >}}
404413
{{< code-panel language="csharp" >}}
405414
// Please create a PR
@@ -408,7 +417,22 @@ public class clear {
408417
# Please create a PR
409418
{{< / code-panel >}}
410419
{{< code-panel language="javascript" >}}
411-
// Please create a PR
420+
const {Builder, By} = require('selenium-webdriver');
421+
(async function example() {
422+
let driver = await new Builder().forBrowser('chrome').build();
423+
try {
424+
// Navigate to Url
425+
await driver.get('https://www.google.com');
426+
// Store 'SearchInput' element
427+
let searchInput = driver.findElement(By.name('q'));
428+
await searchInput.sendKeys("selenium");
429+
// Clears the entered text
430+
await searchInput.clear();
431+
}
432+
finally {
433+
await driver.quit();
434+
}
435+
})();
412436
{{< / code-panel >}}
413437
{{< code-panel language="kotlin" >}}
414438
import org.openqa.selenium.By
@@ -428,4 +452,4 @@ fun main() {
428452
}
429453
}
430454
{{< / code-panel >}}
431-
{{< / code-tab >}}
455+
{{< / code-tab >}}

docs_source_files/content/webdriver/keyboard.ja.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,16 @@ public class clear {
394394
}
395395
{{< / code-panel >}}
396396
{{< code-panel language="python" >}}
397-
# Please create a PR
397+
from selenium import webdriver
398+
driver = webdriver.Chrome()
399+
400+
# Navigate to url
401+
driver.get("http://www.google.com")
402+
# Store 'SearchInput' element
403+
SearchInput = driver.find_element_by_name("q")
404+
SearchInput.send_keys("selenium")
405+
# Clears the entered text
406+
SearchInput.clear()
398407
{{< / code-panel >}}
399408
{{< code-panel language="csharp" >}}
400409
// Please create a PR
@@ -403,7 +412,22 @@ public class clear {
403412
# Please create a PR
404413
{{< / code-panel >}}
405414
{{< code-panel language="javascript" >}}
406-
// Please create a PR
415+
const {Builder, By} = require('selenium-webdriver');
416+
(async function example() {
417+
let driver = await new Builder().forBrowser('chrome').build();
418+
try {
419+
// Navigate to Url
420+
await driver.get('https://www.google.com');
421+
// Store 'SearchInput' element
422+
let searchInput = driver.findElement(By.name('q'));
423+
await searchInput.sendKeys("selenium");
424+
// Clears the entered text
425+
await searchInput.clear();
426+
}
427+
finally {
428+
await driver.quit();
429+
}
430+
})();
407431
{{< / code-panel >}}
408432
{{< code-panel language="kotlin" >}}
409433
import org.openqa.selenium.By
@@ -423,4 +447,4 @@ fun main() {
423447
}
424448
}
425449
{{< / code-panel >}}
426-
{{< / code-tab >}}
450+
{{< / code-tab >}}

docs_source_files/content/webdriver/keyboard.ko.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,16 @@ public class clear {
399399
}
400400
{{< / code-panel >}}
401401
{{< code-panel language="python" >}}
402-
# Please create a PR
402+
from selenium import webdriver
403+
driver = webdriver.Chrome()
404+
405+
# Navigate to url
406+
driver.get("http://www.google.com")
407+
# Store 'SearchInput' element
408+
SearchInput = driver.find_element_by_name("q")
409+
SearchInput.send_keys("selenium")
410+
# Clears the entered text
411+
SearchInput.clear()
403412
{{< / code-panel >}}
404413
{{< code-panel language="csharp" >}}
405414
// Please create a PR
@@ -408,7 +417,22 @@ public class clear {
408417
# Please create a PR
409418
{{< / code-panel >}}
410419
{{< code-panel language="javascript" >}}
411-
// Please create a PR
420+
const {Builder, By} = require('selenium-webdriver');
421+
(async function example() {
422+
let driver = await new Builder().forBrowser('chrome').build();
423+
try {
424+
// Navigate to Url
425+
await driver.get('https://www.google.com');
426+
// Store 'SearchInput' element
427+
let searchInput = driver.findElement(By.name('q'));
428+
await searchInput.sendKeys("selenium");
429+
// Clears the entered text
430+
await searchInput.clear();
431+
}
432+
finally {
433+
await driver.quit();
434+
}
435+
})();
412436
{{< / code-panel >}}
413437
{{< code-panel language="kotlin" >}}
414438
import org.openqa.selenium.By
@@ -428,4 +452,4 @@ fun main() {
428452
}
429453
}
430454
{{< / code-panel >}}
431-
{{< / code-tab >}}
455+
{{< / code-tab >}}

docs_source_files/content/webdriver/keyboard.nl.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,16 @@ public class clear {
399399
}
400400
{{< / code-panel >}}
401401
{{< code-panel language="python" >}}
402-
# Please create a PR
402+
from selenium import webdriver
403+
driver = webdriver.Chrome()
404+
405+
# Navigate to url
406+
driver.get("http://www.google.com")
407+
# Store 'SearchInput' element
408+
SearchInput = driver.find_element_by_name("q")
409+
SearchInput.send_keys("selenium")
410+
# Clears the entered text
411+
SearchInput.clear()
403412
{{< / code-panel >}}
404413
{{< code-panel language="csharp" >}}
405414
// Please create a PR
@@ -408,7 +417,22 @@ public class clear {
408417
# Please create a PR
409418
{{< / code-panel >}}
410419
{{< code-panel language="javascript" >}}
411-
// Please create a PR
420+
const {Builder, By} = require('selenium-webdriver');
421+
(async function example() {
422+
let driver = await new Builder().forBrowser('chrome').build();
423+
try {
424+
// Navigate to Url
425+
await driver.get('https://www.google.com');
426+
// Store 'SearchInput' element
427+
let searchInput = driver.findElement(By.name('q'));
428+
await searchInput.sendKeys("selenium");
429+
// Clears the entered text
430+
await searchInput.clear();
431+
}
432+
finally {
433+
await driver.quit();
434+
}
435+
})();
412436
{{< / code-panel >}}
413437
{{< code-panel language="kotlin" >}}
414438
import org.openqa.selenium.By
@@ -428,4 +452,4 @@ fun main() {
428452
}
429453
}
430454
{{< / code-panel >}}
431-
{{< / code-tab >}}
455+
{{< / code-tab >}}

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

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,16 @@ public class clear {
399399
}
400400
{{< / code-panel >}}
401401
{{< code-panel language="python" >}}
402-
# Please create a PR
402+
from selenium import webdriver
403+
driver = webdriver.Chrome()
404+
405+
# Navigate to url
406+
driver.get("http://www.google.com")
407+
# Store 'SearchInput' element
408+
SearchInput = driver.find_element_by_name("q")
409+
SearchInput.send_keys("selenium")
410+
# Clears the entered text
411+
SearchInput.clear()
403412
{{< / code-panel >}}
404413
{{< code-panel language="csharp" >}}
405414
// Please create a PR
@@ -408,7 +417,22 @@ public class clear {
408417
# Please create a PR
409418
{{< / code-panel >}}
410419
{{< code-panel language="javascript" >}}
411-
// Please create a PR
420+
const {Builder, By} = require('selenium-webdriver');
421+
(async function example() {
422+
let driver = await new Builder().forBrowser('chrome').build();
423+
try {
424+
// Navigate to Url
425+
await driver.get('https://www.google.com');
426+
// Store 'SearchInput' element
427+
let searchInput = driver.findElement(By.name('q'));
428+
await searchInput.sendKeys("selenium");
429+
// Clears the entered text
430+
await searchInput.clear();
431+
}
432+
finally {
433+
await driver.quit();
434+
}
435+
})();
412436
{{< / code-panel >}}
413437
{{< code-panel language="kotlin" >}}
414438
import org.openqa.selenium.By
@@ -428,4 +452,4 @@ fun main() {
428452
}
429453
}
430454
{{< / code-panel >}}
431-
{{< / code-tab >}}
455+
{{< / code-tab >}}

0 commit comments

Comments
 (0)