1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
package SeleniumSessions; import java.io.File; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; /** * * @author Sarang * Created on 20/04/2019 * */ public class DesiredCapabilitiesChrome { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver","chromedriver.exe"); ChromeOptions options = new ChromeOptions(); // To disable Info bar saying - Chrome is being controlled By Automated Software options.addArguments("--disable-infobars"); // To add specific Extentions on Automated Browser controlled via selenium at fresh Instance ex - AddBlockerPlus options.addExtensions(new File("../JanSeleniumTraining/AddBlockerPlus.crx")); options.addExtensions(new File("../JanSeleniumTraining/AddBlock.crx")); // To set SSL Cerificated as True which is not available with some Websites options.setAcceptInsecureCerts(true); WebDriver driver = new ChromeDriver(options); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("http://www.popuptest.com/goodpopups.html"); } } |