selenium chrome driver select certificate popup confirmation not working

后端 未结 5 891
旧时难觅i
旧时难觅i 2020-12-10 05:09

I am automating tests using selenium chromewebdriver 3.7. Whenever I lauch the site, I get a certificate selection popup like the one below

However I am not able to

5条回答
  •  醉酒成梦
    2020-12-10 06:08

    I had the same problem and I was able to solve it by using the robot, creating function for the url and passing it to a different thread.

        Runnable mlauncher = () -> {
        try {
    
          driver.get(url);
         } catch (Exception e) {
              e.printStackTrace();
           }
        };
    
    public void myfunction {
     try {
    
       Thread mthread = new Thread(mlauncher);
       mthread.start
    
      robot.keyPress(KeyEvent.VK_ENTER);
      robot.keyRelease(KeyEvent.VK_ENTER);
    
     } catch (Exception e) {
              e.printStackTrace();
           }
    

提交回复
热议问题