1616 *
1717 * @package WebDriver
1818 *
19- * @method string attribute($attributeName) Get the value of an element's attribute.
2019 * @method void clear() Clear a TEXTAREA or text INPUT element's value.
2120 * @method void click() Click on an element.
2221 * @method boolean displayed() Determine if an element is currently displayed.
2524 * @method array location() Determine an element's location on the page.
2625 * @method array location_in_view() Determine an element's location on the screen once it has been scrolled into view.
2726 * @method string name() Query for an element's tag name.
28- * @method array property($propertyName) Get element property.
2927 * @method array rect() Get element rect.
3028 * @method array screenshot() Take element screenshot.
3129 * @method array selected() Is element selected?
@@ -51,12 +49,10 @@ class Element extends Container
5149 protected function methods ()
5250 {
5351 return array (
54- 'attribute ' => array ('GET ' ),
5552 'clear ' => array ('POST ' ),
5653 'click ' => array ('POST ' ),
5754 'enabled ' => array ('GET ' ),
5855 'name ' => array ('GET ' ),
59- 'property ' => array ('GET ' ),
6056 'rect ' => array ('GET ' ),
6157 'screenshot ' => array ('GET ' ),
6258 'selected ' => array ('GET ' ),
@@ -113,6 +109,20 @@ public function getID()
113109 return $ this ->id ;
114110 }
115111
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+
116126 /**
117127 * Query the value of an element’s computed CSS property: /session/:sessionId/element/:id/css/:propertyName
118128 *
@@ -127,6 +137,20 @@ public function css($propertyName)
127137 return $ result ['value ' ];
128138 }
129139
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+
130154 /**
131155 * Get element shadow root: /session/:sessionId/element/:elementId/shadow
132156 *
0 commit comments