-1

I have a problem to run codeception on centos7 server in headless mode with chromedriver.On mac evrything is fine. I log in via ssh, run chromedriver --verbose --url-base=/wd/hub, then I run php bin/codecept run acceptance -vvv.

But then I'm getting this error

[Facebook\WebDriver\Exception\NoSuchElementException] no such element: Unable to locate element: {"method":"xpath","selector":"//li/a[contains(.,"Sign in")]"}
(Session info: headless chrome=66.0.3359.139)
(Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 4.4.127-mainline-rev1 x86_64)

I dont know how to fix it. Can somebody help me

  • 1
    Please read why [a screenshot of code is a bad idea](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). Paste the code and properly format it instead. – JeffC Jun 16 '18 at 04:10
  • Thanks for the comment. I removed image and copy and paste part of code – Vladan Zivanovic Jun 16 '18 at 07:28
  • your locator is invalid – Corey Goldberg Jun 16 '18 at 15:00
  • Can you give me more information. Please – Vladan Zivanovic Jun 16 '18 at 15:35
  • If you need I could give you more information – Vladan Zivanovic Jun 16 '18 at 18:26
  • Check these discussions [Selenium “selenium.common.exceptions.NoSuchElementException” when using Chrome](https://stackoverflow.com/questions/47993443/selenium-selenium-common-exceptions-nosuchelementexception-when-using-chrome/47995294#47995294) and [NoSuchElementExeption, selenium unable to locate element](https://stackoverflow.com/questions/48471321/nosuchelementexeption-selenium-unable-to-locate-element/48472940#48472940) to address _NoSuchElementException_ – undetected Selenium Jun 18 '18 at 07:18
  • This is not my case. My tests work fine on my local machines(Mac and Ubuntu 16.04). On server doesn't work. And html and snapshoot that are created are blank pages. NoSuchElementException got because pages are blank. Something else it's not ok. But I don't know what. I'm using chromedriver 2.40 – Vladan Zivanovic Jun 18 '18 at 08:42
  • @VladanZivanovic I'm getting the same issue, did you find a solution? For me, chrome-driver and centOS7 don't seem to want to work correctly in headless mode. The tests run but it can't find any page elements and I can't blank screenshots also. I tried both using XyFB and not and still can't work it out. – Simon N Sep 16 '18 at 23:41

1 Answers1

0

try to take a screenshot of the page using $->makeScreenshot('filenameHere'); your "browser" may not be in fullscreen and cant see the element with "Sign in"