Skip to content

Commit ea86e31

Browse files
committed
[Java] Link code sample to github [deploy site]
1 parent 4e77ee1 commit ea86e31

File tree

4 files changed

+11
-95
lines changed

4 files changed

+11
-95
lines changed

website_and_docs/content/documentation/webdriver/elements/file_upload.en.md

+2-23
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,8 @@ languages will be as follows -
1919

2020
{{< tabpane langEqualsHeader=true >}}
2121
{{< 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">}}
4524
{{< /tab >}}
4625
{{< tab header="Python" >}}
4726
from selenium import webdriver

website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md

+3-24
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,9 @@ The code to upload the file for different programming
1818
languages will be as follows -
1919

2020
{{< 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 >}}
4524
{{< tab header="Python" >}}
4625
from selenium import webdriver
4726
driver.implicitly_wait(10)

website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md

+3-24
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,9 @@ Apresentamos alguns exemplos de código para subir os arquivos em diversas lingu
1818

1919

2020
{{< 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 >}}
4524
{{< tab header="Python" >}}
4625
from selenium import webdriver
4726
driver.implicitly_wait(10)

website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md

+3-24
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,9 @@ aliases: [
1616

1717

1818
{{< 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 >}}
4322
{{< tab header="Python" >}}
4423
from selenium import webdriver
4524
driver.implicitly_wait(10)

0 commit comments

Comments
 (0)