In this video, we will see Selenium Add Extension To Chrome Browser At Runtime | Add Extension in Browser in Selenium Webdriver
Program Code:
import java.io.File;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class AddExtensions {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver_win32\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("C:\\Users\\parag\\Downloads\\SelectorsHub.crx"));
options.setAcceptInsecureCerts(true);
WebDriver driver=new ChromeDriver(options);
driver.manage().window().maximize();
driver.get("https://expired.badssl.com/");
System.out.println(driver.getTitle());
}
}
Watch following video:
Watch on YouTube: https://www.youtube.com/watch?v=mZJpfvG9tEc
No comments:
Post a Comment