Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Ruby bindings: empty/default profile disables native events. #3163

Closed
lukeis opened this issue Mar 3, 2016 · 3 comments
Closed

Ruby bindings: empty/default profile disables native events. #3163

lukeis opened this issue Mar 3, 2016 · 3 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3163

This is sort of a tl;dr ticket for http://code.google.com/p/selenium/issues/detail?id=3075
, but:

The following code:


      profile = Selenium::WebDriver::Firefox::Profile.new
      # See http://code.google.com/p/selenium/issues/detail?id=3154
      profile['toolkit.telemetry.prompted'] = 2
      profile['toolkit.telemetry.rejected'] = true

      caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile =>
profile)
      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => caps)


causes firefox to run without native events.  This code uses native events:


      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => @browser.to_sym )


As does this:


      profile = Selenium::WebDriver::Firefox::Profile.new
      print "profile: #{profile.inspect}\n"
      # See http://code.google.com/p/selenium/issues/detail?id=3154
      profile['toolkit.telemetry.prompted'] = '2'
      profile['toolkit.telemetry.rejected'] = 'true'
      profile.native_events = true
      print "profile: #{profile.inspect}\n"

      caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile =>
profile,
                                                               :browser_name      
   => "firefox",
                                                               :javascript_enabled
   => true,
                                                               :takes_screenshot  
   => true,
                                                               :css_selectors_enabled
=> true,
                                                               :native_events     
   => true
                                                              )
      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => caps)


Note that in that last one, the important line is " profile.native_events = true";
with that commented out, things break again.

So, apparently Selenium::WebDriver::Firefox::Profile.new defaults to native events
off, but having no profile with the remote driver defaults to them on.  That is, to
put it mildly, *surprising*, especially since there's no obvious indicator as to whether
we're in native event mode or not.

-Robin

Reported by robinleepowell on 2012-01-07 02:55:58

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by ajaykemparaj on 2012-01-10 19:19:44

  • Labels added: Component-WebDriver, Lang-Ruby

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

On linux systems default is to not use native events.

To get information about current mode one should check browser capabilities that can
be obtained by @driver.capabilities property

Reported by barancev on 2012-12-12 20:55:00

  • Status changed: WorkingAsIntended

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:14:31

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant