Turn off SSL for scenarios with Selenium

Posted Over 12 years ago. Visible to the public.

Selenium does not speak SSL because it uses WEBrick that doesn't. When you use Selenium for Cucumber scenarios that visit pages with SSL, they will fail.

To turn off SSL only for scenarios that are executed on WEBrick, put this method into your application controller.

def ensure_proper_protocol
  request.headers['SERVER_SOFTWARE'].andand.include?('WEBrick') || super
end
Dominik Schöler
Last edit
Almost 12 years ago
Keywords
rails, cucumber
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2011-09-07 08:25)