1

When I want to have automated browser function with selenium-webdriver, I write at first with chrome driver and then make it run with phantomjs.

But sometimes the two browsers behave differently and the function fails to run with phantomjs while selenium-webdriver works fine.

Currently, to find out what is wrong I am struggling in command line. I wonder if there is a way to run phantomjs with "head" so that I can see the problem at a glance. Or maybe is there way to make chrome behave exactly like phantomjs?

I'm aware of some web site are restricted to get information by headless server, I'd give up in that case.

ironsand
  • 14,329
  • 17
  • 83
  • 176
  • Related: http://stackoverflow.com/questions/24769471/phantomjs-but-not-headless and http://stackoverflow.com/questions/23593396/truly-headless-web-browser-with-non-headless-abilites – Artjom B. Dec 28 '14 at 09:36
  • 2
    Basically there is nothing practical you can besides taking a bunch of screenshots and piecing together what's going on. – Artjom B. Dec 28 '14 at 09:40

1 Answers1

0

I faced with the same situation a time ago. In that case I used this gem to take a screenshot on each capybara failure. It doesn't answer to you what has exactly happened, but at least you can find out if page has required elements and so on.

Tim Tonkonogov
  • 1,099
  • 10
  • 14