Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Handle "Select a Certificate popup" in chrome browser for Selenium Java #5408

Closed
vatsa9902 opened this issue Jan 30, 2018 · 6 comments

Comments

@vatsa9902
Copy link

Meta -

OS:
Windows 7

Selenium Version:
2.33

Browser Version:
Chrome v63.0.3239.132

Steps to reproduce -

Launch the application which has security certificate associated. On launching we get "Select a Certificate popup" . How to avoid this and how to handle this.

Tried adding the certificate to trusted source dint work

Please find the screenshot attached for the screen obtained.

image

@luke-hill
Copy link
Contributor

luke-hill commented Jan 30, 2018

You are using a version of Selenium that is seriously beyond support.

If you insist on using the 2.x series, you have to be using 2.53 (Last 2.x version).

Otherwise try upgrade to at least selenium 3.7+ Especially if you're running a new version of chrome (v63)

Also on a sidenote: You're interacting with a pop-up which is out of the remit of browser automation directly. I'd look into additional packages that can assist you there. Or ask on a mailing list such as Selenium. But overall this doesn't feel very "bug" related.

@barancev barancev closed this as completed Feb 1, 2018
@Karthi96
Copy link

How to resolve this? Still unable to resolve that?

@JobaDiniz
Copy link

You're interacting with a pop-up which is out of the remit of browser automation directly. I'd look into additional packages that can assist you there

That's reasonable, however, the problem is that when we do

line 1: Navigate().GoToUrl(...); //Select Certificate is shown
line 2: //code to interact with the Windows Popup

The line 2 is never reached when the Select Certificate popup is shown, therefore, we cannot interact with it.
Any ideas?

@Pfheonix
Copy link

Pfheonix commented Aug 14, 2018

INavigation.GoToUrl() is blocking. That means line 2 will not be reached because GoToUrl() waits until the loading is completed.

1: Task.Run(() => driverObject.Navigate().GoToUrl());
2: //Other code which will run while that waits.

The above "works," but I am not sure that it is reliably useful.

@JobaDiniz
Copy link

The main problem is that any action can trigger the popup, eg .Click() can trigger a navigation and that navigation can show the popup. So far there is not an actual solution other than what you proposed

@Pfheonix
Copy link

Very true. But you know your environment, as this is a test situation, and you should know your environment as well as can be expected given what closed source applications you may need to work with. You should know where the navigation should be expected to occur and reduce the testing as much as feasible to prevent navigation which requires a re-authentication. Or, better yet, make the framework asynchronous through expansion in your own project, then await when you have made too much progress to be able to continue without the return of the task. That's what the await is there for. Hell, await everything and check if there may be a pop up. If the title is stuck on "Loading..." after a timeout, perform the selection action. If it's not, you're probably good.

@lock lock bot locked and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants