public function getContactStatus($username) { $search = $this->driver->findElement(WebDriverBy::cssSelector('[name=query]')); $search->clear(); sleep(1); $search->sendKeys($username); usleep(500); $ppl = $this->driver->findElement(WebDriverBy::cssSelector('ul.people swx-avatar-deprecated:nth-child(1) > span:nth-child(1)')); $class = $ppl->getAttribute('class'); $status = str_replace('tile ', '', $class); return $status; }
/** * @param WebDriverBy $by * @return EventFiringWebElement * @throws WebDriverException */ public function findElement(WebDriverBy $by) { $this->dispatch('beforeFindBy', $by, null, $this); try { $element = $this->newElement($this->driver->findElement($by)); } catch (WebDriverException $exception) { $this->dispatchOnException($exception); } $this->dispatch('afterFindBy', $by, null, $this); return $element; }
/** * @param string $locator * @return WebDriverElement */ protected function _findElement($locator) { return $this->_webDriver->findElement($this->_getLocator($locator)); }