File tree 4 files changed +11
-95
lines changed
website_and_docs/content/documentation/webdriver/elements
4 files changed +11
-95
lines changed Original file line number Diff line number Diff line change @@ -19,29 +19,8 @@ languages will be as follows -
19
19
20
20
{{< tabpane langEqualsHeader=true >}}
21
21
{{< badge-examples >}}
22
- {{< tab header="Java" >}}
23
- import java.util.concurrent.TimeUnit;
24
- import org.openqa.selenium.By;
25
- import org.openqa.selenium.WebDriver;
26
- import org.openqa.selenium.chrome.ChromeDriver;
27
- class fileUploadDoc{
28
- public static void main(String[ ] args) {
29
- WebDriver driver = new ChromeDriver();
30
- driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
31
- driver.get("https://the-internet.herokuapp.com/upload ");
32
- //we want to import selenium-snapshot file.
33
- driver.findElement(By.id("file-upload")).sendKeys("selenium-snapshot.jpg");
34
- driver.findElement(By.id("file-submit")).submit();
35
- if(driver.getPageSource().contains("File Uploaded!")) {
36
- System.out.println("file uploaded");
37
- }
38
- else{
39
- System.out.println("file not uploaded");
40
- }
41
- driver.quit();
42
- }
43
- }
44
-
22
+ {{< tab header="Java" text=true >}}
23
+ {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/FileUploadTest.java#L26-L27">}}
45
24
{{< /tab >}}
46
25
{{< tab header="Python" >}}
47
26
from selenium import webdriver
Original file line number Diff line number Diff line change @@ -18,30 +18,9 @@ The code to upload the file for different programming
18
18
languages will be as follows -
19
19
20
20
{{< tabpane langEqualsHeader=true >}}
21
- {{< tab header="Java" >}}
22
- import java.util.concurrent.TimeUnit;
23
- import org.openqa.selenium.By;
24
- import org.openqa.selenium.WebDriver;
25
- import org.openqa.selenium.chrome.ChromeDriver;
26
- class fileUploadDoc{
27
- public static void main(String[ ] args) {
28
- WebDriver driver = new ChromeDriver();
29
- driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
30
- driver.get("https://the-internet.herokuapp.com/upload ");
31
- //we want to import selenium-snapshot file.
32
- driver.findElement(By.id("file-upload")).sendKeys("selenium-snapshot.jpg");
33
- driver.findElement(By.id("file-submit")).submit();
34
- if(driver.getPageSource().contains("File Uploaded!")) {
35
- System.out.println("file uploaded");
36
- }
37
- else{
38
- System.out.println("file not uploaded");
39
- }
40
- driver.quit();
41
- }
42
- }
43
-
44
- {{< /tab >}}
21
+ {{< tab header="Java" text=true >}}
22
+ {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/FileUploadTest.java#L26-L27">}}
23
+ {{< /tab >}}
45
24
{{< tab header="Python" >}}
46
25
from selenium import webdriver
47
26
driver.implicitly_wait(10)
Original file line number Diff line number Diff line change @@ -18,30 +18,9 @@ Apresentamos alguns exemplos de código para subir os arquivos em diversas lingu
18
18
19
19
20
20
{{< tabpane langEqualsHeader=true >}}
21
- {{< tab header="Java" >}}
22
- import java.util.concurrent.TimeUnit;
23
- import org.openqa.selenium.By;
24
- import org.openqa.selenium.WebDriver;
25
- import org.openqa.selenium.chrome.ChromeDriver;
26
- class fileUploadDoc{
27
- public static void main(String[ ] args) {
28
- WebDriver driver = new ChromeDriver();
29
- driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
30
- driver.get("https://the-internet.herokuapp.com/upload ");
31
- //we want to import selenium-snapshot file.
32
- driver.findElement(By.id("file-upload")).sendKeys("selenium-snapshot.jpg");
33
- driver.findElement(By.id("file-submit")).submit();
34
- if(driver.getPageSource().contains("File Uploaded!")) {
35
- System.out.println("file uploaded");
36
- }
37
- else{
38
- System.out.println("file not uploaded");
39
- }
40
- driver.quit();
41
- }
42
- }
43
-
44
- {{< /tab >}}
21
+ {{< tab header="Java" text=true >}}
22
+ {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/FileUploadTest.java#L26-L27">}}
23
+ {{< /tab >}}
45
24
{{< tab header="Python" >}}
46
25
from selenium import webdriver
47
26
driver.implicitly_wait(10)
Original file line number Diff line number Diff line change @@ -16,30 +16,9 @@ aliases: [
16
16
17
17
18
18
{{< tabpane langEqualsHeader=true >}}
19
- {{< tab header="Java" >}}
20
- import java.util.concurrent.TimeUnit;
21
- import org.openqa.selenium.By;
22
- import org.openqa.selenium.WebDriver;
23
- import org.openqa.selenium.chrome.ChromeDriver;
24
- class fileUploadDoc{
25
- public static void main(String[ ] args) {
26
- WebDriver driver = new ChromeDriver();
27
- driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
28
- driver.get("https://the-internet.herokuapp.com/upload ");
29
- //we want to import selenium-snapshot file.
30
- driver.findElement(By.id("file-upload")).sendKeys("selenium-snapshot.jpg");
31
- driver.findElement(By.id("file-submit")).submit();
32
- if(driver.getPageSource().contains("File Uploaded!")) {
33
- System.out.println("file uploaded");
34
- }
35
- else{
36
- System.out.println("file not uploaded");
37
- }
38
- driver.quit();
39
- }
40
- }
41
-
42
- {{< /tab >}}
19
+ {{< tab header="Java" text=true >}}
20
+ {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/FileUploadTest.java#L26-L27">}}
21
+ {{< /tab >}}
43
22
{{< tab header="Python" >}}
44
23
from selenium import webdriver
45
24
driver.implicitly_wait(10)
You can’t perform that action at this time.
0 commit comments