16
16
*
17
17
* @package WebDriver
18
18
*
19
- * @method string attribute($attributeName) Get the value of an element's attribute.
20
19
* @method void clear() Clear a TEXTAREA or text INPUT element's value.
21
20
* @method void click() Click on an element.
22
21
* @method boolean displayed() Determine if an element is currently displayed.
25
24
* @method array location() Determine an element's location on the page.
26
25
* @method array location_in_view() Determine an element's location on the screen once it has been scrolled into view.
27
26
* @method string name() Query for an element's tag name.
28
- * @method array property($propertyName) Get element property.
29
27
* @method array rect() Get element rect.
30
28
* @method array screenshot() Take element screenshot.
31
29
* @method array selected() Is element selected?
@@ -51,12 +49,10 @@ class Element extends Container
51
49
protected function methods ()
52
50
{
53
51
return array (
54
- 'attribute ' => array ('GET ' ),
55
52
'clear ' => array ('POST ' ),
56
53
'click ' => array ('POST ' ),
57
54
'enabled ' => array ('GET ' ),
58
55
'name ' => array ('GET ' ),
59
- 'property ' => array ('GET ' ),
60
56
'rect ' => array ('GET ' ),
61
57
'screenshot ' => array ('GET ' ),
62
58
'selected ' => array ('GET ' ),
@@ -113,6 +109,20 @@ public function getID()
113
109
return $ this ->id ;
114
110
}
115
111
112
+ /**
113
+ * Get the value of an element's attribute: /session/:sessionId/element/:id/attribute/:name
114
+ *
115
+ * @param string name
116
+ *
117
+ * @return mixed
118
+ */
119
+ public function attribute ($ name )
120
+ {
121
+ $ result = $ this ->curl ('GET ' , "/attribute/ $ name " );
122
+
123
+ return $ result ['value ' ];
124
+ }
125
+
116
126
/**
117
127
* Query the value of an element’s computed CSS property: /session/:sessionId/element/:id/css/:propertyName
118
128
*
@@ -127,6 +137,20 @@ public function css($propertyName)
127
137
return $ result ['value ' ];
128
138
}
129
139
140
+ /**
141
+ * Get element property: /session/:sessionId/element/:id/property/:name
142
+ *
143
+ * @param string $name
144
+ *
145
+ * @return mixed
146
+ */
147
+ public function property ($ name )
148
+ {
149
+ $ result = $ this ->curl ('GET ' , "/property/ $ name " );
150
+
151
+ return $ result ['value ' ];
152
+ }
153
+
130
154
/**
131
155
* Get element shadow root: /session/:sessionId/element/:elementId/shadow
132
156
*
0 commit comments