1
0

WebElement.pm 565 B

1234567891011121314151617181920212223242526272829
  1. package Selenium::Remote::WebElement;
  2. use strict;
  3. use warnings;
  4. use Data::Dumper;
  5. # This is the already instantiated Driver object, which will be passed to the
  6. # constructor when this class is instantiated.
  7. my $driver;
  8. sub new {
  9. my ($class, $id, $parent) = @_;
  10. $driver = $parent;
  11. my $self = {
  12. id => $id,
  13. };
  14. bless $self, $class or die "Can't bless $class: $!";
  15. return $self;
  16. }
  17. sub click {
  18. my ($self) = @_;
  19. my $res = { 'command' => 'clickElement', 'id' => $self->{id} };
  20. return $driver->_execute_command($res);
  21. }
  22. 1;