I am trying to build a mouse for Firefox Webdriver in Ruby: no success so far.
@driver = Selenium::WebDriver.for :firefox, :profile => profile
@mouse = Selenium::WebDriver::Mouse.new(@driver)
@mouse.click(@driver.find_element :css => 'li:nth-child(1)')
Traceback of the mistake
test_add_course(ItemAutocompleteTest):
NoMethodError: undefined method
mouseMoveTo for #<Selenium::WebDriver::Driver:0x7fa66e372b18 browser=:firefox>
/usr/lib/ruby/gems/1.8/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/common/mouse.rb:50:in move_to
/usr/lib/ruby/gems/1.8/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/common/mouse.rb:60:in move_if_needed
/usr/lib/ruby/gems/1.8/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/common/mouse.rb:12:in click
test/selenium_2/item_autocomplete_test.rb:36:in test_add_course
mocha (0.9.8) lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in __send__
mocha (0.9.8) lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in run
1 tests, 0 assertions, 0 failures, 1 errors
Here I found the similar problem
https://gist.github.com/967333
Thank you for any suggestions!
You’ll notice the Mouse class is marked as private in the docs – it’s not part of the public API. To use the advanced user interactions, you want to look at the ActionBuilder instead, basically:
I’ll add a section about this to the wiki page.