-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java]: adding driver options for pageLoadStrategy
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,51 @@ | ||
package dev.selenium.drivers; | ||
|
||
import dev.selenium.BaseTest; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.PageLoadStrategy; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.chrome.ChromeOptions; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
|
||
public class OptionsTest extends BaseTest { | ||
|
||
@Test | ||
public void setPageLoadStrategyNormal() { | ||
ChromeOptions chromeOptions = new ChromeOptions(); | ||
chromeOptions.setPageLoadStrategy(PageLoadStrategy.NORMAL); | ||
WebDriver driver = new ChromeDriver(chromeOptions); | ||
try { | ||
// Navigate to Url | ||
driver.get("https://selenium.dev"); | ||
} finally { | ||
driver.quit(); | ||
} | ||
} | ||
|
||
@Test | ||
public void setPageLoadStrategyEager() { | ||
ChromeOptions chromeOptions = new ChromeOptions(); | ||
chromeOptions.setPageLoadStrategy(PageLoadStrategy.EAGER); | ||
WebDriver driver = new ChromeDriver(chromeOptions); | ||
try { | ||
// Navigate to Url | ||
driver.get("https://selenium.dev"); | ||
} finally { | ||
driver.quit(); | ||
} | ||
} | ||
|
||
@Test | ||
public void setPageLoadStrategyNone() { | ||
ChromeOptions chromeOptions = new ChromeOptions(); | ||
chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE); | ||
WebDriver driver = new ChromeDriver(chromeOptions); | ||
try { | ||
// Navigate to Url | ||
driver.get("https://selenium.dev"); | ||
} finally { | ||
driver.quit(); | ||
} | ||
} | ||
} | ||
|