1

I am experiencing issue with Phantomjs headless automation testing on linux. We are using Jenkins as our CI server. However, we are getting the error below:

     phantomjs://platform/console++.js:263 in error
     [ERROR - 2016-12-09T19:45:12.372Z] WebElementLocator -     
     _handleLocateCommand - Element(s) NOT Found: GAVE UP. 
     Search Stop Time: 1481312712354

     phantomjs://platform/console++.js:263 in error

How we start phantomjs:

     phantomjs --webdriver=8001

Environment:

    Phantomjs: 2.1.1
    Jenkins: 1.598
    Linux:  Linux xxx1247 2.6.32-573.12.1.el6.x86_64  
    Ruby: 1.9.3
    Cucumber: 2.1.4
    Selenium-webdriver: 2.53

Please share your solution. Thanks!

fongfong
  • 175
  • 3
  • 14
  • is this error happening whenever you start phantom, or just when you look for a specific element on the page? It might just be telling you that the element you're searching for doesn't exist. – max pleaner Dec 10 '16 at 01:57
  • Thanks for your comments. It happens every time I start PhantomJS. It works fine on Windows machine though. Any ideas? – fongfong Dec 11 '16 at 20:19
  • @maxpleaner Hi Max, do you guys use Xvfb + firefox for headless test automation? What is your experience? Thanks! – fongfong Dec 15 '16 at 18:40
  • I personally use selenium (with capybara) and xvfb via the `headless` gem, which is great because it can take pictures and video. – max pleaner Dec 15 '16 at 18:57
  • @maxpleaner Thanks for your reply. I am working on using Xvfb as well on linux. But ran into some issue with ruby. Could you please take a look at my question at: `http://stackoverflow.com/questions/41126897/headless-test-automation-with-firefox-using-xvfb-on-linux-jenkins-ci-server/41128789?noredirect=1#comment69543858_41128789` Thanks! – fongfong Dec 16 '16 at 11:34
  • I have just tried locally and on ec2. The `headless` gem starts up xvfb after i install it with `apt-get`. I've never used Jenkins so I'm not sure what the process is like. – max pleaner Dec 16 '16 at 16:19

1 Answers1

1

There can be a few causes for this. One of them can be that the get action to the Web URL failed. That means you are operating on an empty result, which will throw that error.

Since the webpage is not fetched, the element will not be there.

Vincent Gerris
  • 7,228
  • 1
  • 24
  • 22
  • Thank you for your input. Make sense. Due to this limitation on our Linux machine, and we need to test on IE browser, we started taking Jenkins master/slave approach. We are executing our test suites on a windows machine that has IE and Firefox browsers installed. Thanks! – fongfong Mar 16 '17 at 14:42
  • Hi, I don't understand what you mean with the limitation? Also, IE is not a supported browser anymore by modern standards. Happy to get an up vote if the answer was useful ;). I am pretty sure that this has nothing to do with the operating system, but with how it's configured. You either get an empty page because it was not fetched properly, or you actually get a page without the element you look for. – Vincent Gerris Mar 17 '17 at 15:45