原文链接: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)
发表评论
-
Get values from a select list using xpath [closed]
2012-04-04 16:50 0http://stackoverflow.com/que ... -
How do I build Watir tests for websites?
2012-04-04 16:14 0http://stackoverflow.com/que ... -
“TypeError: can't convert String into Integer” when trying to CTRL+click or SHIF
2012-04-04 15:33 0http://stackoverflow.com/que ... -
Using Watir, how can I select a radio control using both name and value?
2012-04-04 15:23 0q http://stackoverflow.com/q ... -
Selecting multiple options in select list with shift
2012-04-04 15:19 0Q http://stackoverflow.com/ques ... -
Drag-and-Drop in Watir
2012-04-04 15:15 0http://www.cheezyworld.com/2010 ... -
How to test onclick in this object without id
2012-04-04 15:13 0http://stackoverflow.com/que ... -
Browser Certificates
2012-04-04 15:01 0http://watirwebdriver.com/b ... -
selected_options returns blank from iframe
2012-04-04 14:48 0link http://stackoverflow.com/q ... -
How to handle tinyMCE when automating with watir-webdriver?
2012-04-04 14:28 0I'm evaluating Watir-webdr ... -
Browser url not returning new url
2012-04-01 17:55 0Qhttp://stackoverflow.com/quest ... -
Can not drive Opera with watir-webdriver on Windows XP
2012-04-01 17:53 0Qhttp://stackoverflow.com/quest ... -
why must I sleep or wait using watir-webdriver and firefox?
2012-04-01 17:50 0Qhttp://stackoverflow.com/quest ... -
Firefox 4 with watir webdriver: Need help using helperApps.neverAsk to save CSV
2012-04-01 17:39 0Q http://stackoverflow.com/q ... -
Watir Webdriver counting number of items in a UL list
2012-04-01 17:22 0Q http://stackoverflow.co ... -
finding the direct child of a tag in watir
2012-04-01 17:13 0Qhttp://stackoverflow.com/quest ... -
How to determine browser type (IE, FF, Chrome, etc.)
2012-04-01 16:59 0Q http://stackoverflow.com/que ... -
Wait methods for watir-webdriver unsuccessful with JS/AJAX and new page load (Er
2012-04-01 16:19 0http://stackoverflow.com/questi ... -
How to send text to a CKEditor WYSIWYG editor box using Watir-WebDriver
2012-04-01 16:14 0Q http://stackoverflow.com/ques ... -
How can I get Browser.text.include? to be case insensitive?
2012-04-01 15:57 0Q:http://stackoverflow.com/ques ...
相关推荐
这篇教程“Adding Security to Spring Petclinic”旨在帮助开发者了解如何将安全特性整合到 Spring Petclinic 示例应用中。Spring Petclinic 是一个基于 Spring Boot 开发的开源项目,它展示了 Spring 框架的各种...
**Need More Buttons in Firefox?** - **简介**:增加浏览器工具栏上的按钮数量,提供更多快捷操作选项。 - **应用场景**:适合需要快速访问特定功能的用户。 ##### 6. **Easy Window Resizing** - **简介**:...
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 ...
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) ...
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 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 ...
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 ...
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
BADI(Business Add-In)是SAP用来扩展标准行为的机制之一。在这一步骤中,您需要创建并实现一个BADI,以处理用户提交的决策。实现BADI的关键步骤包括: - 创建BADI:定义BADI的接口,包括方法签名和参数列表。 - ...
在Oracle Solaris 11.3中添加和更新软件是系统管理员日常维护工作的重要部分。Oracle Solaris操作系统是一个功能强大的企业级操作系统,提供了一系列高级管理工具和服务,以确保系统的稳定性和安全性。...
Oracle Solaris 11.2 是Oracle公司发布的一款先进的操作系统,尤其在企业级服务器和数据中心环境中广泛应用。在Oracle Solaris 11.2中,添加和更新软件是系统管理的重要部分,确保系统的性能、安全性和稳定性。...
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 ...
在本篇文章中,我们将深入探讨如何为SAPUI5中的`TextField`添加占位符功能。此技术是在SAPUI5框架默认不提供占位符功能的情况下实现的一种工作方法。 ### 添加占位符功能 #### 标题和描述概述 ...
cognos_pp_infrastructure_adding_and_removing_ui_sections_in_cognos_connection.pdf,可以定义cognos connection 页面,比如新增链接或者隐藏某些链接等
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, ...
局部指数稳定性定理及证明、中值定理、加权积分器详细介绍