Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.frogking.chromedriver.ChromeDriverBuilder;
- import org.openqa.selenium.chrome.ChromeDriver;
- import org.openqa.selenium.chrome.ChromeDriverService;
- import org.openqa.selenium.chrome.ChromeOptions;
- import java.io.File;
- public class App {
- public static void main(String[] args){
- String driver_home = "your driver home";
- ChromeOptions chrome_options = new ChromeOptions();
- chrome_options.addArguments("--window-size=1920,1080");
- //chrome_options.addArguments("--headless=new"); when chromedriver > 108.x.x.x
- //chrome_options.addArguments("--headless=chrome"); when chromedriver <= 108.x.x.x
- ChromeDriverService service = new ChromeDriverService.Builder()
- .usingDriverExecutable(new File(driver_home))
- .usingAnyFreePort()
- .build();
- //ChromeDriver chromeDriver1 = new ChromeDriver(service);
- ChromeDriver chromeDriver1 = new ChromeDriverBuilder()
- .build(chrome_options,driver_home);
- chromeDriver1.get("https://nowsecure.nl");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement