code: public function workWithElementsInRegion($selector)
      {
          if (in_array($selector, ['html', 'head'])) {
              $element = $this->getSession()->getPage()->find('css', $selector);
          } else {
              $element = $this->element('css', $selector);
          }
  
          $this->setWorkingElement($element);
      }
docs: @param string $selector
  CSS selector or region name.
  
  @Then /^(?:|I )work with elements in "([^"]*)"(?:| region)$/