Thursday, March 23, 2023

Headless Browser Testing in Selenium: Best Tools and Frameworks to Use

 import java.io.IOException;

import org.openqa.selenium.NotFoundException;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

public class Headless_Browser {

public static void main(String[] args) throws IOException, NotFoundException {

ChromeOptions options = new ChromeOptions();

options.addArguments("headless");

WebDriver driver = new ChromeDriver(options);

driver.get("https://suriyaparithy.blogspot.com/");

System.out.println("Title of the page is -> " + driver.getTitle());

}

}

No comments:

Post a Comment