Selenium Testing HTTPs Trust All certificates working for FF but not IE

前端 未结 6 1340
悲&欢浪女
悲&欢浪女 2021-01-06 05:32

I\'ve been playing arround with functional testing using Selenium RC.

I keep running into problems when the test goes to the login page of our site and switches to

相关标签:
6条回答
  • 2021-01-06 06:00

    I have not seen this error with latest version of Selenium RC i.e. 2.31.0. And if you are using:

    RemoteControlConfiguration rc= new RemoteControlConfiguration();
        rc.trustAllSSLCertificates();
        SeleniumServer server;
        server=new SeleniumServer(rc);
    
    0 讨论(0)
  • 2021-01-06 06:00

    IE displays the cert error as a normal html page. Since it does that, you can find the element and do a .click() on it as a temporary workaround. :) You can just create a cert helper class to do it and just execute cert.acceptCert(driver);

    0 讨论(0)
  • 2021-01-06 06:04

    For some random reason IE now seems fine so I stick with the configuration as it is and try and sort the FF problems.

    0 讨论(0)
  • 2021-01-06 06:07

    This answer doesn't directly answer "Why doesn't Trust All certificates work with IE?", however it does offer an answer to the question that likely gave rise to the question being asked here. i.e. for anyone running Selenium as a Windows Service and find that it does not trust their self-signed certificates.

    The Problem

    IE does not trust the root and issuing certificates of a self-signing authority and therefore presents a page requesting the user to decide if he/she wants to continue and trust the site. This prevents any selenium tests progressing.

    The Solution

    The solution is relatively simple and logical in concept, the root and issuing certificates must be installed on the computer as trusted certs.

    However, the complexity lies in getting the Windows Service running Selenium RC to trust the certificates if the service runs under a system account. To rectify this, the following steps are required.

    1. Install the Root certificate as a computer-wide trusted certification authority.
    2. Install the Issuing certificate as a computer-wide intermediate certification authority

    Adding certificates to the Trusted Root Certification Authorities store for a local computer

    Administrators is the minimum group membership required to complete this procedure.

    To add certificates to the Trusted Root Certification Authorities store for a local computer

    1. Click Start, click Start Search, type mmc, and then press ENTER.
    2. On the File menu, click Add/Remove Snap-in.
    3. Under Available snap-ins, click Certificates,and then click Add.
    4. Under This snap-in will always manage certificates for, click Computer account, and then click Next.
    5. Click Local computer, and click Finish.
    6. If you have no more snap-ins to add to the console, click OK.
    7. In the console tree, double-click Certificates.
    8. Right-click the Trusted Root Certification Authorities store.
    9. Click Import to import the certificates and follow the steps in the Certificate Import Wizard.

    Adding certificates to the Intermediate Certification Authorities store for a local computer

    1. In the console tree, double-click Certificates.
    2. Right-click the Intermediate Certification Authorities store.
    3. Click Import to import the certificates and follow the steps in the Certificate Import Wizard.
    0 讨论(0)
  • 2021-01-06 06:11

    I have managed to get this to work by setting the -trustAllSSLCertificates and creating a default profile in FireFox.

    So far I can happily use either browser w/o fear of the untrusted certificate errors showing up.

    its worth noting that the browsers I tell selenium to use are simply *chrome and *iehta.

    0 讨论(0)
  • 2021-01-06 06:14

    There are two steps. One is to start the server with the "-trustAllSSLCertificates" option and the other is to configure the browser to use the Selenium server as its proxy. *iexploreproxy and *firefoxproxy handle the proxy settings for you. Selenium (as of 2.0a5) will auto-configure *firefox to use the Selenium server as a proxy if the "-trustAllSSLCertificates" flag is used. *iexplore, using HTA, is never configured by Selenium to use a proxy. So, you'll need to handle that a priori or via a custom launcher.

    More details in the following article: http://nirvdrum.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium.html

    0 讨论(0)
提交回复
热议问题