Browse Source

get_active_element was supposed to return WebElement, but it wasn't.

Aditya Ivaturi 14 years ago
parent
commit
9fd3edafd3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/Selenium/Remote/Driver.pm

+ 6 - 1
lib/Selenium/Remote/Driver.pm

@@ -1466,7 +1466,12 @@ sub find_child_elements {
 sub get_active_element {
     my ($self) = @_;
     my $res = { 'command' => 'getActiveElement' };
-    return $self->_execute_command($res);
+    my $ret_data = eval { $self->_execute_command($res) };
+    if ($@) {
+        croak $@;
+    } else {
+        return new Selenium::Remote::WebElement($ret_data->{ELEMENT}, $self);
+    }
 }
 
 # Not yet supported on the server