/**
  * @return boolean
  */
 public function equals(Element $element)
 {
     return $this->requestValue('equals/' . $element->getId());
 }
 /**
  * Method to select an element, using a selector (css, xpath, etc.).
  *
  * @param By $by Indicates how to search for the element
  *
  * @return Element
  *
  * @see By
  */
 public function element(By $by, Element $from = null)
 {
     if (null === $from) {
         $uri = 'element';
     } else {
         $uri = 'element/' . $from->getId() . '/element';
     }
     $response = $this->request('POST', $uri, json_encode($by->toArray()));
     $data = json_decode($response->getContent(), true);
     if (!isset($data['value']['ELEMENT'])) {
         throw new LibraryException('Missing key value.ELEMENT');
     }
     $id = $data['value']['ELEMENT'];
     return new Element($this, $id);
 }