Re: [wtr-general] Drag and drop is not working after updating firefox to 20.0 -- Could not load native events component.

1,096 views
Skip to first unread message

Željko Filipin

unread,
Apr 4, 2013, 1:37:53 PM4/4/13
to watir
On Thu, Apr 4, 2013 at 6:18 PM, watir webdriver <watirweb...@gmail.com> wrote:
Today I've updated my firefox 19.2 to 20.0 and drag and drop of the element is not working.

Please post the code that causes the problem. Relevant page or html would help too.

Željko
--
https://leanpub.com/watirbook

Dan

unread,
Apr 4, 2013, 1:57:33 PM4/4/13
to watir-...@googlegroups.com
The release notes of 2.31.0 of the selenium webdriver only indicate support for native events up to version 19.  The selenium team is pretty good about releasing updates to support new versions, you just might have to wait a couple of days or downgrade to 19 in the meantime.

2.31.0 (2013-03-02)
===================

Remote:
  * Expose session_id on the remote driver when used directly (#5240).
Firefox:
  * Native events in Firefox 19
Opera:
  * Treat UNSPECIFIED proxy type as a nil proxy (#5081).
Other:
  * Add ability to pass :desired_capabilities to all the Ruby drivers, not just for :remote.
    Direct arguments take presendence. (#5078, see also https://github.com/SeleniumHQ/selenium/pull/8, https://github.com/SeleniumHQ/selenium/pull/11)


On Thursday, April 4, 2013 12:18:04 PM UTC-4, watir webdriver wrote:
Hi there,

Today I've updated my firefox 19.2 to 20.0 and drag and drop of the element is not working.Those tests were working on the earlier version.
Is the webdriver version not compatible with the FF 20 ? Can anybody suggest me what is the solution for this ?

Using selenium-webdriver (2.31.0)
Using watir-webdriver (0.6.2)
Using page-object (0.8.7)

Getting below exception :

      Cannot perform native interaction: Could not load native events component.
 (Selenium::WebDriver::Error::InvalidElementStateError)
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130404-5472-1ozzmjv/extensions/fxdriver@googlecode.com/components/driver_c
omponent.js:8577:in `generateErrorForNativeEvents'
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130404-5472-1ozzmjv/extensions/fxdriver@googlecode.com/components/driver_c
omponent.js:8610:in `FirefoxDriver.prototype.mouseMove'
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130404-5472-1ozzmjv/extensions/fxdriver@googlecode.com/components/command_
processor.js:10275:in `DelayedCommand.prototype.executeInternal_/h'
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130404-5472-1ozzmjv/extensions/fxdriver@googlecode.com/components/command_
processor.js:10280:in `DelayedCommand.prototype.executeInternal_'
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130404-5472-1ozzmjv/extensions/fxdriver@googlecode.com/components/command_
processor.js:10220:in `DelayedCommand.prototype.execute/<'
      ./features/step_definitions/smartmanager_email_steps.rb:63:in `/^I drag "(
.+)" rule to the position (\d+) slot$/'
      features\smart_manager_email_setup_05.feature:22:in `When I drag "Product
Catalog" rule to the position 1 slot'

Any help is much more appreciated.

watir webdriver

unread,
Apr 5, 2013, 4:53:23 AM4/5/13
to watir-...@googlegroups.com
Thanks both for your reply....

@Dan : Any idea when is the next release ? Where do I get the future release dates ?


Any help is much more appreciated.


Dan

unread,
Apr 5, 2013, 9:16:59 AM4/5/13
to watir-...@googlegroups.com
I don't see anything on the issue tracker that indicates a release date, but they are usually within a week or so as far as I remember.  Best thing to do for now is to downgrade to 19.

You can watch this page for updates as well.

Dan

watir webdriver

unread,
Apr 5, 2013, 9:45:37 AM4/5/13
to watir-...@googlegroups.com
Thanks Dan....I'll downgrade to 19.

Chuck van der Linden

unread,
Apr 5, 2013, 1:42:47 PM4/5/13
to watir-...@googlegroups.com
Testing against the moving target that is firefox can be a bit of a pain sometimes.   What I generally recommend (especially for your primary CI tests if you are using a real (non-headless) browser  is to use the firefox ESR (Extended Support Release).   

The ESR is only updated once a year.  You can bingle and find out more info about their ESR program.  In brief this is something the mozilla folks started doing because corporate IT depts were starting to de-certify Firefox due to the hassle of having to revalidate every six weeks that the latest thing still worked against all their internal web apps and tools.  The corporate world was starting to say 'FU Mozilla', so this was was their solution to that.

I like to have the ESR on at least some of my test-runner environments, and the current FF on others..  if stuff in the current FF breaks, I can tag those tests with something like @FF_ESR_Only  and exclude them from runs against the current ff, but still test them against other browsers and the ESR.  Once a new webdriver is released I can test just those failing tests, and remove the tags from the ones that get 'fixed' 

This presumes you are using a framework that allows some way to 'tag' tests and include or exclude them from test runs according to tags.. (for example, Cucumber) 

watir webdriver

unread,
Apr 6, 2013, 2:39:51 PM4/6/13
to watir-...@googlegroups.com
Hi Chuck,

Thanks for the detailed explanation and suggestion.I'll give a try...

Chuck van der Linden

unread,
Apr 8, 2013, 1:07:26 PM4/8/13
to watir-...@googlegroups.com
Yeah it won't fix your problem with the current version, but it can at least give you a stable env that can be used to test YOUR stuff as opposed to what can sometimes amount to testing firefox's ability to update and break stuff vs webdriver's ability to adapt to those changes.

Dan

unread,
Apr 10, 2013, 9:28:32 AM4/10/13
to watir-...@googlegroups.com
Looks like there's a new version.  Also, the safari extension, which is awesome!

2.32.0 (2013-04-09)
===================

Safari:
  * The Safari extension is now packaged with the gem and automatically installed (#5322)
  * Improved detection of the binary location on 64-bit windows (5273)
Opera:
  * Allow passing :desired_capabailities (#5279)
Firefox:
  * This release supports versions 10esr, 17esr, 19, 20.
  * Improved SVG support
Other:
  * Allow #click_and_hold without target (#5410).
  * Remove assumptions about returned capabilities (for ios-driver)

Chuck van der Linden

unread,
Apr 10, 2013, 5:08:10 PM4/10/13
to watir-...@googlegroups.com
Thanks for letting folks know about the update!

watir webdriver

unread,
Apr 11, 2013, 4:39:04 AM4/11/13
to watir-...@googlegroups.com
Hi Dan,
Thanks for letting me know.
I've updated selenium webdriver to 2.32.0 but still I'm facing the same issue.

Chuck van der Linden

unread,
Apr 16, 2013, 1:49:38 PM4/16/13
to watir-...@googlegroups.com
That brings us back to "please show us the code that is causing the error.. "  

watir webdriver

unread,
Apr 17, 2013, 6:04:25 AM4/17/13
to watir-...@googlegroups.com
First of all thanks for the response...Plz find cucumber test,Step def,application screenshot,html code and error msg as below.

Cucumber test : In my application I've many algorithms out of them I've to drag one and drop it to position1 slot.

When I drag "Abandoned Basket" rule to the position 1 slot

Step def :
When /^I drag "(.+)" rule to the position (\d+) slot$/ do |algorithm, position|
  index = position.to_i - 1
  rule = @browser.span(:text => algorithm)
  slot = @browser.div(:id => index.to_s)
  rule.drag_and_drop_on(slot)
end


Error msg :

    When I drag "Abandoned Basket" rule to the position 1 slot

      Cannot perform native interaction: Could not load native events component.
 (Selenium::WebDriver::Error::InvalidElementStateError)
      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130417-12004-1hejfln/extensions/fxdr...@googlecode.com/components/driver_
component.js:8699:in `generateErrorForNativeEvents'

      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130417-12004-1hejfln/extensions/fxdr...@googlecode.com/components/driver_
component.js:8732:in `FirefoxDriver.prototype.mouseMove'

      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130417-12004-1hejfln/extensions/fxdr...@googlecode.com/components/command
_processor.js:10421:in `DelayedCommand.prototype.executeInternal_/h'

      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130417-12004-1hejfln/extensions/fxdr...@googlecode.com/components/command
_processor.js:10426:in `DelayedCommand.prototype.executeInternal_'

      [remote server] file:///C:/Users/fsultana/AppData/Local/Temp/webdriver-pro
file20130417-12004-1hejfln/extensions/fxdr...@googlecode.com/components/command
_processor.js:10366:in `DelayedCommand.prototype.execute/<'

      ./features/step_definitions/smartmanager_email_steps.rb:63:in `/^I drag "(
.+)" rule to the position (\d+) slot$/'
      features\smart_manager_email_setup_05.feature:23:in `When I drag "Abandone
d Basket" rule to the position 1 slot'


HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<body>
<div id="logo">
<div class="spacersmall"></div>
<form id="switchSiteShopAdminForm" method="post">
<div class="spacersmall"></div>
<div id="header">
<div id="wrapper">
<div id="menu">
<div id="content">
<ul id="tabs">
<div class="clear"></div>
<script type="text/javascript">
<em id="help" bt-xtitle="" title="">
<form id="editWidget" method="POST">
<fieldset class="fieldset">
<legend>Widget Settings</legend>
<input type="hidden" value="true" name="active">
<input id="id" type="hidden" value="-1" name="id">
<div class="spacer"></div>
<label for="name">Name</label>
<input type="text" size="60" maxlength="100" value="" name="name">
<div class="clear"></div>
<div class="spacer"></div>
<p> Two images compose each recommendation. The 1st one is the image of the product. The 2nd one is the image of all text that accompany the recommended product, i.e. the product title, the product price, a discount and so on. In the following section, please define the accompanying text styles. Please click "Advanced" to edit the html/css code. In advanced mode you will be able to use normal html/css to style these pieces of content. The preview pane always reflect your changes, so please feel free to play around with the available options, no harm will be done! </p>
<fieldset id="productStyles" class="fieldset">
<label for="howMany">Number Of Items</label>
<input id="howMany" type="text" value="1" name="howMany" size="2">
<div class="clear"></div>
<div class="spacer"></div>
<label for="locale">Locale</label>
<select name="location">
<div class="spacer"></div>
<input id="tags" type="hidden" value="" name="tags">
<div class="spacer"></div>
<p>Please insert here any tracking code you want to be added in the product link url</p>
<label for="trackingCode">Tracking Code</label>
<input id="trackingCode" value="" name="trackingCode">
<div class="spacer"></div>
<label for="algorithms">Recommendations</label>
<div class="spacer"></div>
<p>
<div class="spacer"></div>
<table class="tree2">
<div class="spacer"></div>
<div class="t1container">
<table class="tree1">
<tbody>
<tr>
<td>
<span class="draggable ui-draggable" full="Abandoned Basket" aid="ABANDONED_BASKET">Abandoned Basket</span>
</td>
<td>
<span class="draggable ui-draggable" full="Cross-sell, previous purchases and views" aid="OTHER_CUSTOMER_BASKET_ADDITIONS">Cross-sell, previous purchases and views</span>
</td>
<td>
<span class="draggable ui-draggable" full="Other customers popular social" aid="OTHER_CUSTOMERS_POPULAR_SOCIAL">Other customers popular social</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Back in stock complementary products" aid="BACK_IN_STOCK_COMPLEMENTARY_PRODUCTS">Back in stock complementary products</span>
</td>
<td>
<span class="draggable ui-draggable" full="Customer viewed history" aid="CUSTOMER_VIEWED_HISTORY">Customer viewed history</span>
</td>
<td>
<span class="draggable ui-draggable" full="Popular items from Favourite categories" aid="CUSTOMER_PURCHASE_HISTORY">Popular items from Favourite categories</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Back in stock popular social" aid="BACK_IN_STOCK_POPULAR_SOCIAL">Back in stock popular social</span>
</td>
<td>
<span class="draggable ui-draggable" full="Emerging products (last 30 days)" aid="EMERGING_PRODUCTS">Emerging products (last 30 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Product Catalog" aid="CATALOG">Product Catalog</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Seller By Revenue in Smart Category" aid="BESTSELLER_BY_REVENUE_SMART_CATEGORY">Best Seller By Revenue in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="Emerging products (last 30 days) in Smart Category" aid="EMERGING_PRODUCTS_SMART_CATEGORY">Emerging products (last 30 days) in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="Recently Viewed" aid="RECENTLY_VIEWED">Recently Viewed</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Seller by Revenue per Product View (last 90 days)" aid="BESTSELLER_BY_REVENUE_PER_VIEW">Best Seller by Revenue per Product View (last 90 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="New Products(last 14 days)" aid="NEW_PRODUCTS_14Days">New Products(last 14 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Recommendations based on Abandoned Basket" aid="RECOMMENDATIONS_FOR_ABANDONED_BASKET_PRODUCTS">Recommendations based on Abandoned Basket</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Seller by Revenue per Product View in Smart Category" aid="BESTSELLER_BY_REVENUE_PER_VIEW_SMART_CATEGORY">Best Seller by Revenue per Product View in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="New Products(last 30 days)" aid="NEW_PRODUCTS_30Days">New Products(last 30 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Registration teaser based on basket additions" aid="REGISTRATION_TEASER_BASED_ON_BASKET_ADDITIONS">Registration teaser based on basket additions</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Sellers by Conversion (last 90 days)" aid="BESTSELLER_BY_CONVERSION">Best Sellers by Conversion (last 90 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="New Products(last 7 days)" aid="NEW_PRODUCTS_7Days">New Products(last 7 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Registration teaser based on popular view" aid="REGISTRATION_TEASER_POPULAR_VIEW">Registration teaser based on popular view</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Sellers by Conversion in Smart Category" aid="BESTSELLER_BY_CONVERSION_SMART_CATEGORY">Best Sellers by Conversion in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="New products from favourite categories(last 120 days)" aid="NEW_PRODUCTS_FROM_FAV_CATEGORIES">New products from favourite categories(last 120 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Wishlist co-purchased" aid="WISH_LIST_CO_PURCHASED">Wishlist co-purchased</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Sellers by Revenue ( last 28 days)" aid="BESTSELLER_BY_REVENUE">Best Sellers by Revenue ( last 28 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="New products(last 120 days) in Smart Category" aid="NEW_PRODUCTS_SMART_CATEGORY">New products(last 120 days) in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="Wishlist highly viewed" aid="WISH_LIST_HIGHLY_VIEWED">Wishlist highly viewed</span>
</td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Sellers by Units (last 7 days)" aid="BESTSELLER_BY_UNITS">Best Sellers by Units (last 7 days)</span>
</td>
<td>
<span class="draggable ui-draggable" full="Order Uplifter Bought Together" aid="ORDER_UPLIFTER_BOUGHT_TOGETHER">Order Uplifter Bought Together</span>
</td>
<td></td>
</tr>
<tr>
<td>
<span class="draggable ui-draggable" full="Best Sellers by Units in Smart Category" aid="BESTSELLER_BY_UNITS_SMART_CATEGORY">Best Sellers by Units in Smart Category</span>
</td>
<td>
<span class="draggable ui-draggable" full="Order Uplifter Popular Social" aid="ORDER_UPLIFTER_POPULAR_SOCIAL">Order Uplifter Popular Social</span>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
Your help is much more appreciated.
draganddrop.jpg

watir webdriver

unread,
Apr 23, 2013, 4:07:20 AM4/23/13
to watir-...@googlegroups.com
Any one can help on this?
--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
 
---
You received this message because you are subscribed to a topic in the Google Groups "Watir General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/watir-general/sIHP_jJDDeg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to watir-genera...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rich Downie

unread,
Apr 23, 2013, 7:06:08 AM4/23/13
to watir-...@googlegroups.com


You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

watir webdriver

unread,
Apr 23, 2013, 7:22:56 AM4/23/13
to watir-...@googlegroups.com
Thanks Rich for your email but its throwing below exception...Can you plz tell me where i've to define this driver element?

      undefined local variable or method `driver' for #<Object:0x3f9dec0> (NameE
rror)
      ./features/step_definitions/smartmanager_email_steps.rb:64:in `/^I drag "(

.+)" rule to the position (\d+) slot$/'
      features\smart_manager_email_setup_05.feature:23:in `When I drag "Abandone
d Basket" rule to the position 1 slot'

Implemented as below :

When /^I drag "(.+)" rule to the position (\d+) slot$/ do |algorithm, position|
  index = position.to_i - 1
  rule = driver.span(:text => algorithm)
 slot = driver.div(:id => index.to_s)
 driver.action.drag_and_drop(rule, slot).perform
end


Thanks in advance...

Rich Downie

unread,
Apr 23, 2013, 7:33:06 AM4/23/13
to watir-...@googlegroups.com
driver = whatever variable you use to declare Watir::Browser.new.

For cucumber this variable should be declared in:
features/support/env.rb

require 'watir-webdriver'
Before do
  driver = Watir::Browser.new
end

You may have:
  browser = Watir::Browser.new

resulting in:
  browser.action.drag_and_drop(rule, slot).perform

watir webdriver

unread,
Apr 23, 2013, 10:37:42 AM4/23/13
to watir-...@googlegroups.com
This time its throwing below exception :

     undefined method `action' for #<Watir::Browser:0x3ff51a8> (NoMethodError)

     ./features/step_definitions/smartmanager_email_steps.rb:63:in `/^I drag "(
+)" rule to the position (\d+) slot$/'
     features\smart_manager_email_setup_05.feature:23:in `When I drag "Abandone
 Basket" rule to the position 1 slot'

Implemented as below :

When /^I drag "(.+)" rule to the position (\d+) slot$/ do |algorithm, position|
  index = position.to_i - 1
  rule = @browser.span(:text => algorithm)
  slot = @browser.div(:id => index.to_s)
  @browser.action.drag_and_drop(rule, slot).perform
 end

My Hooks.rb :

Before do
    @browser = Watir::Browser.new :firefox
 end

Thanks in advance

Rich Downie

unread,
Apr 23, 2013, 10:49:42 AM4/23/13
to watir-...@googlegroups.com
Maybe try drag_and_drop_by ?

  #
    # Drag and drop this element by the given offsets.
    # Note that browser support may vary.
    #
    # @example
    #    browser.div(:id => "draggable").drag_and_drop_by 100, -200
    #
    # @param [Fixnum] right_by
    # @param [Fixnum] down_by
    #

    def drag_and_drop_by(right_by, down_by)
      assert_exists
      assert_has_input_devices_for :drag_and_drop_by

      driver.action.
             drag_and_drop_by(@element, right_by, down_by).
             perform
    end

watir webdriver

unread,
Apr 23, 2013, 12:05:57 PM4/23/13
to watir-...@googlegroups.com
Atlast got the solution for this issue..Its a bug in selenium webdriver (Issue-4478).

Disabled the native events in hooks.rb as below :
  profile.native_events = false
   caps = Selenium::WebDriver::Remote::Capabilities.firefox(:native_events => false)

watir webdriver

unread,
Apr 23, 2013, 12:06:31 PM4/23/13
to watir-...@googlegroups.com
Thanks experts for your help and time...
Reply all
Reply to author
Forward
0 new messages