1

I am automating tests using selenium chrome webdriver. Whenever I launch the site, I get a certificate selection popup like the one below:

The following code works in Java:

    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();
       }

I have not found code that works in c#.

michal
  • 103
  • 1
  • 8
  • What do you mean by: `"I have not found code that works in c#"`? This SO post has some alternatives to Robot class, perhaps it will help you (https://stackoverflow.com/questions/49511160/c-sharp-equivalent-to-java-robot-class?rq=1) – Ryan Wilson Jan 21 '20 at 14:07
  • Do you want to select a certificate Or you want to cancel / ignore pop up – Muzzamil Jan 21 '20 at 14:34
  • I want to select a certificate and press OK – michal Jan 21 '20 at 15:31
  • Did you ever get a resolution on this? I have exactly the same issue and finding any useful advice very difficult to find. – CJH Oct 27 '20 at 15:28
  • I found solution - use AutoIt.AutoItX library Like: `AutoIt.AutoItX.Send("{TAB}", 0); AutoIt.AutoItX.Send(url, 10); AutoIt.AutoItX.Send("{ENTER}", 0);` – michal Oct 28 '20 at 17:21

1 Answers1

0

I try with your solution, I use AutoIt.AutoItX library and use it to select a certificate but I have a problem.

when I click in the LogIn button, it show on the popup possibility to select ssl certificate.

The execution of the automatic test stops, and waits for the selection of the certificate. When I manually select certificate, my automatic test continues with further execution, of that part that should select automaticly certificate in AutoIt.AutoItX.

It should contue automaticly without stopping, AutoIt.AutoItX part should not be on hold, but should be used to select a certificate.

{
welcomePage.LogIn.Click();

AutoIt.AutoItX.Send("{TAB}", 0);             
AutoIt.AutoItX.Send(url, 10);             
AutoIt.AutoItX.Send("{ENTER}", 0);
}
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30020465) – j__carlson Oct 07 '21 at 17:50