While accessing the application there is a browser notification appearing to select the certificate in order to proceed further and view the login page. I need to run the tests in headless mode.
I tried couple of things to do this:
- Using chrome capabilities - Even after setting the below properties it still shows the popup.
chromeOptions.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
chromeOptions.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
- Using parallel java threading - It is working sometimes and sometimes not without headless mode. In headless mode it is not even working once. Reference: java threading
Thread t1 = new Thread(new Runnable() {
@Override
public void run()
{
System.out.println("The Custom URL: " + strUrl);
objDriverController.getDriver().get(strUrl);
}
});
Thread t2 = new Thread(new Runnable() {
@Override
public void run()
{
autoClick();
}
});
try {
// start t1 thread that tries to open the URL
t1.start();
// start t2 thread that click on
// the Enter button using Robot class
t2.start();
// Using below 2 lines we
// run both the thread in parallel
t1.join();
t2.join();
t2.interrupt();
t1.interrupt();
}
catch (InterruptedException e) {
e.printStackTrace();
}
- Editing Registry editor - It worked when browser opens, not in headless mode.
Selenium version - 4.1.1 Chrome version - 114.0.5735.199 Java Version - 17.0.6