Kaynağa Gözat

Added support for the concept of WebElement.

Aditya Ivaturi 15 yıl önce
ebeveyn
işleme
7482e81734
1 değiştirilmiş dosya ile 29 ekleme ve 0 silme
  1. 29 0
      lib/Selenium/Remote/WebElement.pm

+ 29 - 0
lib/Selenium/Remote/WebElement.pm

@@ -0,0 +1,29 @@
+package Selenium::Remote::WebElement;
+
+use strict;
+use warnings;
+use Data::Dumper;
+
+# This is the already instantiated Driver object, which will be passed to the
+# constructor when this class is instantiated.
+my $driver;
+
+sub new {
+    my ($class, $id, $parent) = @_;
+    $driver = $parent;
+    my $self = {
+        id => $id,
+    };
+    bless $self, $class or die "Can't bless $class: $!";
+    return $self;
+}
+
+sub click {
+    my ($self) = @_;
+    my $res = { 'command' => 'clickElement', 'id' => $self->{id} };
+    return $driver->_execute_command($res);
+}
+
+
+
+1;