… | |
… | |
226 | (e.g. C<capabilities>). |
226 | (e.g. C<capabilities>). |
227 | |
227 | |
228 | No session-dependent methods must be called before this function returns |
228 | No session-dependent methods must be called before this function returns |
229 | successfully. |
229 | successfully. |
230 | |
230 | |
231 | On success, C<< $wd->{sid} >> is set to the session id, and C<< |
231 | On success, C<< $wd->{sid} >> is set to the session ID, and C<< |
232 | $wd->{capabilities} >> is set to the returned capabilities. |
232 | $wd->{capabilities} >> is set to the returned capabilities. |
233 | |
233 | |
234 | my $wd = new AnyEvent::Selenium endpoint => "http://localhost:4545"; |
234 | my $wd = new AnyEvent::Selenium endpoint => "http://localhost:4545"; |
235 | |
235 | |
236 | $wd->new_session ({ |
236 | $wd->new_session ({ |
… | |
… | |
476 | =cut |
476 | =cut |
477 | |
477 | |
478 | =item $element_id = $wd->find_element ($location_strategy, $selector) |
478 | =item $element_id = $wd->find_element ($location_strategy, $selector) |
479 | |
479 | |
480 | Finds the first element specified by the given selector and returns its |
480 | Finds the first element specified by the given selector and returns its |
481 | web element id (the strong, not the object from the protocol). Raises an |
481 | web element ID (the strong, not the object from the protocol). Raises an |
482 | error when no element was found. |
482 | error when no element was found. |
483 | |
483 | |
484 | $element = $wd->find_element ("css selector" => "body a"); |
484 | $element = $wd->find_element ("css selector" => "body a"); |
485 | $element = $wd->find_element ("link text" => "Click Here For Porn"); |
485 | $element = $wd->find_element ("link text" => "Click Here For Porn"); |
486 | $element = $wd->find_element ("partial link text" => "orn"); |
486 | $element = $wd->find_element ("partial link text" => "orn"); |
… | |
… | |
894 | =cut |
894 | =cut |
895 | |
895 | |
896 | =item $object = $wd->element_object ($element_id) |
896 | =item $object = $wd->element_object ($element_id) |
897 | |
897 | |
898 | Encoding element ids in data structures is done by represetning them as an |
898 | Encoding element ids in data structures is done by represetning them as an |
899 | object with a special key and the element id as value. This helper method |
899 | object with a special key and the element ID as value. This helper method |
900 | does this for you. |
900 | does this for you. |
901 | |
901 | |
902 | =cut |
902 | =cut |
903 | |
903 | |
904 | sub element_object { |
904 | sub element_object { |