Skip to content

Commit

Permalink
[java]: adding driver options for pageLoadStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha509 committed Dec 20, 2023
1 parent cd40924 commit b3c02bb
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java
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();
}
}
}

0 comments on commit b3c02bb

Please sign in to comment.