`
lilingjay
  • 浏览: 8709 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

Adding security exceptions in Firefox

阅读更多

原文链接:http://stackoverflow.com/questions/5589139/adding-security-exceptions-in-firefox

Question:

 

I have a script running watir-webdriver(using Firefox 4.0) that needs to access a web page that Firefox thinks has an invalid certificate.

The problem is that after I accept the certificate, Firefox just goes right back to the same page as if I never accepted it.

This only occurs if Firefox was started from watir-webdriver. If I start it manually, it will properly accept the security exception.

 

Answer:

A1:The Firefox driver creates a new anonymous profile for each instance, so that it's working in your default profile but not with WebDriver isn't that suprising.

WebDriver is usually pretty good at dealing with certificate issues, but there is an edge case: you're serving a valid certificate that doesn't match the host name it's served from (e.g. production certificates in a test environment). If that's the case, you'll want to set a flag in the Firefox profile:

profile = Selenium::WebDriver::Firefox::Profile.new
profile.assume_untrusted_certificate_issuer = false

browser = Watir::Browser.new(:firefox, :profile => profile)

If that doesn't help, you can also just use your default profile as a model:

browser = Watir::Browser.new(:firefox, :profile => "default")

A2:Have your tried going to Tools->Options->-Advanced->Encryption Tab Then click the Validation button and uncheck use the Online Certificate Status Protocol (OCSP) ...

You can disable this programatically with the Ruby bindings for Selenium e.g.

require 'selenium-webdriver'
require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile["security.OCSP.enabled"] = 0
driver = Selenium::WebDriver.for :firefox, :profile => profile
browser = Watir::Browser.new(driver)
分享到:
评论

相关推荐

    翻译 Spring Security - Tutorial: Adding Security to Spring Petclinic

    这篇教程“Adding Security to Spring Petclinic”旨在帮助开发者了解如何将安全特性整合到 Spring Petclinic 示例应用中。Spring Petclinic 是一个基于 Spring Boot 开发的开源项目,它展示了 Spring 框架的各种...

    Firefox Facts(ebook)

    **Need More Buttons in Firefox?** - **简介**:增加浏览器工具栏上的按钮数量,提供更多快捷操作选项。 - **应用场景**:适合需要快速访问特定功能的用户。 ##### 6. **Easy Window Resizing** - **简介**:...

    The.Security.Consultants.Handbook.

    security management leadership, adding value, and professional proficiency) Legislation and regulation (including relevant UK and international laws such as the Human Rights Act 1998, the Data ...

    lua 5.3.5 windows预编译exe/dll文件 lua5.3.5.win.zip

    adding: lua5.3.5-x86/lua.exe (in=14336) (out=7311) (deflated 49%) adding: lua5.3.5-x86/lua.o (in=24873) (out=9654) (deflated 61%) adding: lua5.3.5-x86/lua5.3.5-static.lib (in=662596) (out=244441) ...

    sec_hdp_security_overview.pdf

    Security is essential for organizations that store and process sensitive data in the Hadoop ecosystem. Many organizations must adhere to strict corporate security polices. Hadoop is a distributed ...

    Security Control For VB.NET Applications

    Security Control is a user control designed in Microsoft.Net (VB) Environment. It is very usefull for implementing security (role based authentication) in desktop applications. Through this control ...

    Android Application Security Essentials

    Adding a new permission 57 Creating a permission group 58 Creating a permission tree 59 Summary 60 Chapter 4: Defining the Application's Policy File 61 The AndroidManifest.xml file 61 Application ...

    Building.a.Home.Security.System.with.Raspberry.Pi.17821

    This book is for anyone who is interested in building a modular home security system from scratch using a Raspberry Pi board, basic electronics, sensors, and simple scripts. This book is ideal for ...

    Adding New Hardware for Avaya

    Adding New Hardware for Avaya

    SAP Fiori - Adding a Custom Workflow in 6 Steps

    BADI(Business Add-In)是SAP用来扩展标准行为的机制之一。在这一步骤中,您需要创建并实现一个BADI,以处理用户提交的决策。实现BADI的关键步骤包括: - 创建BADI:定义BADI的接口,包括方法签名和参数列表。 - ...

    Oracle Solaris 11.3 Adding and Updating Software in Oracle Solar

    在Oracle Solaris 11.3中添加和更新软件是系统管理员日常维护工作的重要部分。Oracle Solaris操作系统是一个功能强大的企业级操作系统,提供了一系列高级管理工具和服务,以确保系统的稳定性和安全性。...

    Oracle Solaris 11.2 Adding and Updating Software in Oracle Solar

    Oracle Solaris 11.2 是Oracle公司发布的一款先进的操作系统,尤其在企业级服务器和数据中心环境中广泛应用。在Oracle Solaris 11.2中,添加和更新软件是系统管理的重要部分,确保系统的性能、安全性和稳定性。...

    Manning.Spring.in.Action.4th.Edition.2014.11.epub

    Praise for the Third Edition of Spring in Action Preface Acknowledgments About this Book 1. Core Spring Chapter 1. Springing into action 1.1. Simplifying Java development 1.1.1. Unleashing the power ...

    Adding placeholder functionality for TextField in SAPUI5

    在本篇文章中,我们将深入探讨如何为SAPUI5中的`TextField`添加占位符功能。此技术是在SAPUI5框架默认不提供占位符功能的情况下实现的一种工作方法。 ### 添加占位符功能 #### 标题和描述概述 ...

    cognos_pp_infrastructure_adding_and_removing_ui_sections_in_cognos_connection.pdf

    cognos_pp_infrastructure_adding_and_removing_ui_sections_in_cognos_connection.pdf,可以定义cognos connection 页面,比如新增链接或者隐藏某些链接等

    Professional ASP.NET 3.5 SP1 Edition: In C# and VB(part1)

    Methods for adding AJAX capabilities to your ASP.NET applications * The many benefits of the new data access additions * Ways to use and extend the Provider Model for accessing data stores, ...

Global site tag (gtag.js) - Google Analytics