How can I use Headless Browser with Selenium and C#.Net.
I am new in selenium so can any help me.
How can I use Headless Browser with Selenium and C#.Net.
I am new in selenium so can any help me.
While there are several such headless browsers available in the market, the following are the most popular ones:
Pseudo code:
package chrome;
public class HeadlessTesting {
public static void main(String[] args) throws IOException{
System.setProperty("webdriver.chrome.driver",
"ChromeDriverPath");
ChromeOptions options = new ChromeOptions();
options.addArguments("headless");
options.addArguments("window-size=1200x600");
WebDriver driver = new ChromeDriver(options);
driver.get("https://contentstack.built.io");
driver.get("https://www.google.co.in/");
System.out.println("title is: " + driver.getTitle());
File scrFile = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("pathTOSaveFile"));
driver.quit();
}
}