public function clickElementByText($text, $selector, $textSelector = null, $baseElement = null)
    {
        $element = $this->getElementByText($text, $selector, $textSelector, $baseElement);
        if ($element && $element->isVisible()) {
            $element->click();
        } elseif ($element) {
            throw new \Exception("Can't click '$text' element: not visible");
        } else {
            throw new \Exception("Can't click '$text' element: not Found");
        }
    }
public function clickElementByText($text, $selector, $textSelector = null, $baseElement = null)
    {
        $element = $this->getElementByText($text, $selector, $textSelector, $baseElement);
        if ($element && $element->isVisible()) {
            $element->click();
        } elseif ($element) {
            throw new \Exception("Can't click '$text' element: not visible");
        } else {
            throw new \Exception("Can't click '$text' element: not Found");
        }
    }
public function clickElementByText ( $ text , $ selector , $ textSelector = null , $ baseElement = null ) { $ element = $ this -> getElementByText ( $ text , $ selector , $ textSelector , $ baseElement ) ; if ( $ element && $ element -> isVisible ( ) ) { $ element -> click ( ) ; } elseif ( $ element ) { throw new \ Exception ( "Can't click '$text' element: not visible" ) ; } else { throw new \ Exception ( "Can't click '$text' element: not Found" ) ; } }
Finds an HTML element by class and the text value and clicks it.

@param string    $text           Text value of the element
@param string    $selector       CSS selector of the element
@param string    $textSelector   Extra CSS selector for text of the element
@param string    $baseElement    Element in which the search is based
Finds an HTML element by class and the text value and clicks it .