|
@@ -47,7 +47,7 @@ has 'driver' => (
|
|
|
|
|
|
|
|
sub click {
|
|
sub click {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'clickElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'clickElement', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -64,7 +64,7 @@ sub click {
|
|
|
|
|
|
|
|
sub submit {
|
|
sub submit {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'submitElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'submitElement', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -95,7 +95,7 @@ sub submit {
|
|
|
|
|
|
|
|
sub send_keys {
|
|
sub send_keys {
|
|
|
my ( $self, @strings ) = @_;
|
|
my ( $self, @strings ) = @_;
|
|
|
- my $res = { 'command' => 'sendKeysToElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'sendKeysToElement', 'id' => $self->id };
|
|
|
map { $_ .= "" } @strings;
|
|
map { $_ .= "" } @strings;
|
|
|
my $params = {
|
|
my $params = {
|
|
|
'value' => \@strings,
|
|
'value' => \@strings,
|
|
@@ -119,7 +119,7 @@ sub send_keys {
|
|
|
|
|
|
|
|
sub is_selected {
|
|
sub is_selected {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'isElementSelected', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'isElementSelected', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -137,7 +137,7 @@ sub is_selected {
|
|
|
|
|
|
|
|
sub set_selected {
|
|
sub set_selected {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'setElementSelected', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'setElementSelected', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -159,7 +159,7 @@ sub set_selected {
|
|
|
|
|
|
|
|
sub toggle {
|
|
sub toggle {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'toggleElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'toggleElement', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,7 +178,7 @@ sub toggle {
|
|
|
|
|
|
|
|
sub is_enabled {
|
|
sub is_enabled {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'isElementEnabled', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'isElementEnabled', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -198,7 +198,7 @@ sub is_enabled {
|
|
|
|
|
|
|
|
sub get_element_location {
|
|
sub get_element_location {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'getElementLocation', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'getElementLocation', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -221,7 +221,7 @@ sub get_element_location {
|
|
|
|
|
|
|
|
sub get_element_location_in_view {
|
|
sub get_element_location_in_view {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'getElementLocationInView', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'getElementLocationInView', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -240,7 +240,7 @@ sub get_element_location_in_view {
|
|
|
|
|
|
|
|
sub get_tag_name {
|
|
sub get_tag_name {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'getElementTagName', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'getElementTagName', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -256,7 +256,7 @@ sub get_tag_name {
|
|
|
|
|
|
|
|
sub clear {
|
|
sub clear {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'clearElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'clearElement', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -284,7 +284,7 @@ sub get_attribute {
|
|
|
}
|
|
}
|
|
|
my $res = {
|
|
my $res = {
|
|
|
'command' => 'getElementAttribute',
|
|
'command' => 'getElementAttribute',
|
|
|
- 'id' => $self->{id},
|
|
|
|
|
|
|
+ 'id' => $self->id,
|
|
|
'name' => $attr_name,
|
|
'name' => $attr_name,
|
|
|
};
|
|
};
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
@@ -323,7 +323,7 @@ sub get_value {
|
|
|
|
|
|
|
|
sub is_displayed {
|
|
sub is_displayed {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'isElementDisplayed', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'isElementDisplayed', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -348,7 +348,7 @@ sub drag {
|
|
|
if ( ( not defined $x ) || ( not defined $y ) ) {
|
|
if ( ( not defined $x ) || ( not defined $y ) ) {
|
|
|
croak 'X & Y pixel coordinates not provided';
|
|
croak 'X & Y pixel coordinates not provided';
|
|
|
}
|
|
}
|
|
|
- my $res = { 'command' => 'dragElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'dragElement', 'id' => $self->id };
|
|
|
my $params = {
|
|
my $params = {
|
|
|
'x' => $x,
|
|
'x' => $x,
|
|
|
'y' => $y,
|
|
'y' => $y,
|
|
@@ -372,7 +372,7 @@ sub drag {
|
|
|
|
|
|
|
|
sub get_size {
|
|
sub get_size {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'getElementSize', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'getElementSize', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -391,7 +391,7 @@ sub get_size {
|
|
|
|
|
|
|
|
sub get_text {
|
|
sub get_text {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'getElementText', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'getElementText', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -421,7 +421,7 @@ sub get_css_attribute {
|
|
|
}
|
|
}
|
|
|
my $res = {
|
|
my $res = {
|
|
|
'command' => 'getElementValueOfCssProperty',
|
|
'command' => 'getElementValueOfCssProperty',
|
|
|
- 'id' => $self->{id},
|
|
|
|
|
|
|
+ 'id' => $self->id,
|
|
|
'property_name' => $attr_name,
|
|
'property_name' => $attr_name,
|
|
|
};
|
|
};
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
@@ -439,7 +439,7 @@ sub get_css_attribute {
|
|
|
|
|
|
|
|
sub describe {
|
|
sub describe {
|
|
|
my ($self) = @_;
|
|
my ($self) = @_;
|
|
|
- my $res = { 'command' => 'describeElement', 'id' => $self->{id} };
|
|
|
|
|
|
|
+ my $res = { 'command' => 'describeElement', 'id' => $self->id };
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|