原文链接: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 ...
相关推荐
NULL 博文链接:https://liu-weiaa.iteye.com/blog/666585
including advancements in hardware and services security, interdependency networks, risk analysis, and control systems security along with their underlying protocols. Novel attacks against Critical ...
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 ...
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 ...
Oracle Solaris 11.3 Adding and Updating Software in Oracle Solaris 11.3-190
Oracle Solaris 11.2 Adding and Updating Software in Oracle Solaris 11.2-134
SAP Fiori - Adding a Custom Workflow in 6 Steps
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 system call in linux
Adding placeholder functionality for TextField in SAPUI5
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
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 ...
Unity's single codebase approach minimizes inefficient switching among development tools and concentrates your attention on making great interactive experiences. Unity in Action teaches you how to ...
cognos_pp_infrastructure_adding_and_removing_ui_sections_in_cognos_connection.pdf,可以定义cognos connection 页面,比如新增链接或者隐藏某些链接等
A tutorial on adding columns to Explorer’s details view via a column handler shell extension.(13KB)
Taking the pain out of adding a horizontal scrollbar to a listbox.给列表框添加水平滚动条
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, ...