博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[selenium] Handling "Untrusted SSL certificate" error in firefox
阅读量:6511 次
发布时间:2019-06-24

本文共 942 字,大约阅读时间需要 3 分钟。

Sometimes we see the below error while accessing a website.Then how to handle that error???

This connection is untrusted.

You have asked Firefox to connect securely to mail.google.com,but we can’t confirm that your connection is secure.

 

You need to use firefox profile here.

 

import org.openqa.selenium.WebDriver;import org.openqa.selenium.firefox.FirefoxDriver;import org.openqa.selenium.firefox.FirefoxProfile;public class CrossBrowser {	private static WebDriver driver;	private static String browserType="FIREFOX"; 	public static void main(String[] args) {		if(browserType.equals("FIREFOX")){		FirefoxProfile profile = new FirefoxProfile();    		profile.setEnableNativeEvents(true);	    		profile.setAcceptUntrustedCertificates(true);    		profile.setAssumeUntrustedCertificateIssuer(true); 		    driver=new FirefoxDriver(profile);     }}

 

We can use the profile concept only in firefox.

 

转载于:https://www.cnblogs.com/qingshuihe/p/4972339.html

你可能感兴趣的文章