Skip to content

Commit

Permalink
Added Java Example to Selenium Manager (#1966)
Browse files Browse the repository at this point in the history
* Added Java Example

* Update examples/java/src/test/java/dev/selenium/selenium_manager/usage.java

Co-authored-by: Sri Harsha <[email protected]>

* [java] fix code sample

---------

Co-authored-by: Sri Harsha <[email protected]>
Co-authored-by: Sri Harsha <[email protected]>
  • Loading branch information
3 people authored Jan 6, 2025
1 parent 215adae commit 36ce362
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dev.selenium.selenium_manager;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SeleniumManagerUsageDemo {

@Test
public void testSetupWithoutManager() {
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("https://www.selenium.dev/documentation/selenium_manager/");
driver.quit();
}

@Test
public void testSetupWithManager() {
WebDriver driver = new ChromeDriver();
driver.get("https://www.selenium.dev/documentation/selenium_manager/");
driver.quit();
}

}
7 changes: 5 additions & 2 deletions website_and_docs/content/documentation/selenium_manager.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
### Implementing Selenium Manager in Your Scripts

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{% tab header="Java" %}}
**Previously**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L10-L15" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L18-L22" >}}
{{< /tab >}}
{{% tab header="Python" %}}
**Previously**
Expand Down
7 changes: 5 additions & 2 deletions website_and_docs/content/documentation/selenium_manager.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
### Implementing Selenium Manager in Your Scripts

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{% tab header="Java" %}}
**Previously**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L10-L15" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L18-L22" >}}
{{< /tab >}}
{{% tab header="Python" %}}
**Previously**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
### Implementing Selenium Manager in Your Scripts

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{% tab header="Java" %}}
**Previously**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L10-L15" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L18-L22" >}}
{{< /tab >}}
{{% tab header="Python" %}}
**Previously**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c
### Implementing Selenium Manager in Your Scripts

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{% tab header="Java" %}}
**Previously**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L10-L15" >}}
**Selenium Manager**
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/selenium_manager/SeleniumManagerUsageDemo.java#L18-L22" >}}
{{< /tab >}}
{{% tab header="Python" %}}
**Previously**
Expand Down

0 comments on commit 36ce362

Please sign in to comment.