Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

hover: Error while executing command: Server returned error code 404 and no data #20

Closed
MattiL opened this Issue · 6 comments

6 participants

@MattiL

hover does not seem to work even though the element seems to be found all right and click on the same element works.

hover: Error while executing command: Server returned error code 404 and no data at /Library/Perl/5.10.0/Selenium/Remote/WebElement.pm line 39

Selenium::Remote::Driver version 0.12. Mac OS X 10.6.8. Firefox 8.0.1.

    my $element;
    eval {
        $element = $driver->find_element("//descendant::img[contains(\@src,'map-pin_big_')][$index]");
    };
    if ($@) {
        diag("Could not find image: $@");
        last;
    }
    eval {
        $element->hover();
    };
    if ($@) {
        diag("hover: $@");
        exit 1;
    }
@gordolio
Collaborator

It looks like the hover method may be deprecated. I don't see it anywhere in the JsonWireProtocol. http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/moveto
(but i'm sure it was there at some point). It may have been replaced by 'move_to'.

You should be able use this with

    my $element;
    eval {
        $element = $driver->find_element("//descendant::img[contains(\@src,'map-pin_big_')][$index]");
    };
    if ($@) {
        diag("Could not find image: $@");
        last;
    }
    eval {
        $driver->move_to(element => $element);
    };
    if ($@) {
        diag("hover: $@");
        exit 1;
    }

Let me know if this works and I will either deprecate the method or change it to call move_to

EDIT: The move_to command takes a hash as the arguments. I updated the above code to reflect that.

@MattiL

$driver->move_to(element => $element); works: it triggers the same behavior "mouseover" as WebDriver click and Remote Control mouse_over.

@brianmed
Collaborator

Note to self: Investigate if hover has been replace with move_to.

@brianmed brianmed was assigned
@markstos
Collaborator

I think this can be closed, because I no longer see a hover() method in our API, just the move_to() method.

@markstos markstos closed this
@sergiod1981

Hi guays. I having the same error msg.

this is my code
$elem = $driver->find_element('(439784975)' , 'partial_link_text');
$driver->get_active_element();
$driver->send_modifier('Ctrl','down');
$elem->click();
$driver->send_modifier('Ctrl','up');

Please, can you help me?

thanks.

@areyoutoo

I'm still getting this error with v0.17 off of CPAN. WebElement.pm still contains a hover method at line 444.

Simple example to reproduce:

use strict;
use Selenium::Remote::Driver;

my $sel = Selenium::Remote::Driver->new();
$sel->get("http://google.com");

my $search_button = $sel->find_element('//*[@id="gbqfsa"]');
$search_button->hover;
@areyoutoo areyoutoo referenced this issue from a commit in areyoutoo/Selenium-Remote-Driver
@areyoutoo areyoutoo fix #20; WebElement::hover calls Driver::move_to 056d374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.