CERTIFICATE ALERT when using Google Chrome!

576 views
Skip to first unread message

Cinderella

unread,
Feb 25, 2010, 8:51:31 PM2/25/10
to Selenium Users
Hi all,

I am using Selenium to test a website with Google Chrome. The website
needs a security connection with https. When I manually use Chrome to
open it, there is NOT any problem (because I have imported the needed
cert in security option which is from IE options). But when Selenium
opens Chrome, I think it always opens a "clean" Chrome without any
settings. At this time, when connecting to the website, there is
always a "The site's security certificate is not trusted!" alert
screen. I must press "Proceed anyway" button to continue.

So, how can I solve this problem? I want Selenium to use Chrome with
the same steps as in other browsers. Does anybody know?

Thank you!

darrell

unread,
Feb 26, 2010, 2:28:00 PM2/26/10
to Selenium Users
The solution for Firefox is to create a Firefox profile, add the
certificate to the profile then start the Selenium server using the
Firefox profile. For Chrome, I suspect, you want the same concept. Use
the *custom to launch the browser. That is, "*custom <path to chrome +
command line switch to use new profile>". You'll have to poke around
the web or look at the source code for Chrome to figure out the
command line switches.

Cinderella

unread,
Mar 1, 2010, 12:49:01 AM3/1/10
to Selenium Users
Hi darrell,

Thanks for your answer. I have tried your solution, but there is a
problem. I changed the browser to:

*custom "C:\Documents and Settings\yangmw\Local Settings\Application
Data\Google\Chrome\Application\chrome.exe" --user-data-dir="C:
\Documents and Settings\yangmw\Local Settings\Application Data\Google
\Chrome\User Data\Selenium"

The ...User Data\Selenium is a Chrome profile that I have created.

But it cannot be started. Selenium server report the following error.

Could you please help me on this problem? Thank you!!


ERROR MESSAGES:

11:46:22.475 ERROR - Failed to start new browser session, shutdown
browser and clear all session data
java.lang.NullPointerException
at
org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchRemoteSession(AbstractBrowserLauncher.java:
30)
at
org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:
357)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
122)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
84)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:
699)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:
393)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:
364)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:
125)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:
820)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:
837)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:
534)
11:46:22.475 INFO - Got result: Failed to start new browser session:
Error while launching browser on session null

> > Thank you!- Hide quoted text -
>
> - Show quoted text -

Niraj Kumar

unread,
Mar 1, 2010, 2:38:45 AM3/1/10
to seleniu...@googlegroups.com
Hi,

We got the solution for avoiding security confirmation .
Step1. Create a firefox profile to some location (i.e c:\nk) and start firefox with this profile
 close all firefox browser  and go to run--> firefox -P then create a new profile then
Step 2. Install " Remember Certificate exception from
https://addons.mozilla.org/en-US/firefox/addon/10246

Remember Certificate Exception

Step 3. 
Create setup with following configuration settings after that you dont have to click on ok button this will do all for you.

import org.openqa.selenium.server.RemoteControlConfiguration;

  public void setUp() throws Exception {
        //seleniumServer = new SeleniumServer();
        File template = new File("C:\\nk");
        RemoteControlConfiguration rc = new RemoteControlConfiguration();
        rc.trustAllSSLCertificates();
       
        rc.setAvoidProxy(true);
        rc.setPort(4444);
       
        rc.setTrustAllSSLCertificates(true);
        rc.setSingleWindow(true);
        rc.setFirefoxProfileTemplate(template);
        seleniumServer = new SeleniumServer(rc);
       
        selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com");
        seleniumServer.start();
        selenium.start();
      
    }

Let me know if you have still issue


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Thanks & Regard,
Niraj Kumar

Cinderella

unread,
Mar 1, 2010, 3:33:12 AM3/1/10
to Selenium Users
Hi Niraj Kumar,

Thanks for your reply! Maybe my question was not clear. That problem
was on "Google Chrome", not Firefox. I have tried your code, but in
Google Chrome, there is still this issue. Do you have any ideas on
it?


On Mar 1, 3:38 pm, Niraj Kumar <bewith.ni...@gmail.com> wrote:
> Hi,
>
> We got the solution for avoiding security confirmation .
> Step1. Create a firefox profile to some location (i.e c:\nk) and start
> firefox with this profile
>  close all firefox browser  and go to run--> firefox -P then create a new
> profile then
> Step 2. Install " Remember Certificate exception fromhttps://addons.mozilla.org/en-US/firefox/addon/10246

> > org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchR­emoteSession(AbstractBrowserLauncher.java:
> > 30)
> >        at
>
> > org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(Bro­wserSessionFactory.java:
> > 357)
> >        at
>
> > org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(Brows­erSessionFactory.java:
> > 122)
> >        at
>
> > org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(Brows­erSessionFactory.java:
> > 84)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSessi­on(SeleniumDriverResourceHandler.java:
> > 699)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Selenium­DriverResourceHandler.java:
> > 393)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandReque­st(SeleniumDriverResourceHandler.java:
> > 364)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDri­verResourceHandler.java:

> > selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/selenium-users?hl=en.
>
> --
> Thanks & Regard,

> Niraj Kumar- Hide quoted text -

nitinkcv

unread,
Apr 23, 2010, 10:22:53 AM4/23/10
to Selenium Users
Just curious did you get a solution to this?
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

martino

unread,
Apr 24, 2010, 3:40:13 AM4/24/10
to Selenium Users
Hi,
I am interested too in this topic, any suggestion or workaround to use
google chrome and opera?

Jim Evans

unread,
Jun 25, 2013, 10:19:50 AM6/25/13
to seleniu...@googlegroups.com
Anyone got anywhere with this? Can't use Firefox as selenium doesn't work with it any more.

Krishnan Mahadevan

unread,
Jun 25, 2013, 10:38:44 AM6/25/13
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Jim Evans

unread,
Jun 25, 2013, 11:04:38 AM6/25/13
to seleniu...@googlegroups.com
Can you define what you mean by, "Selenium doesn't work with [Firefox] anymore?" That's a pretty broad statement, without a lot of context. You haven't said what "doesn't work." You haven't said what version of Firefox you're using, nor what version of Selenium. You haven't said whether you're using RC or WebDriver. The Selenium project runs upwards of 700 tests against four different versions of Firefox on every commit to the code base[1], so forgive the bluntness, but extraordinary claims require extraordinary proof.

--Jim

[1] http://ci.seleniumhq.org:8080

Reply all
Reply to author
Forward
0 new messages