0

I am using Python bindings for Selenium WebDriver and Ghostdriver/Phantomjs in UI automation that I have developed. I was wondering if there was a way that when I send a request to the Ghostdriver service, I can somehow "stop" the execution of the ghostdriver code so that I could step through the code line by line, like in a debugger.

Is there a method to do this? The only thing I can think of is putting log statements into the ghostdriver source and compiling the phantomjs source, but that seems like a very unwieldy approach. Not sure I could even do that.

user1941192
  • 43
  • 1
  • 7
  • Why would you want to step through the ghostdriver code? What are you hoping to find eventually? – Artjom B. Aug 04 '15 at 21:20
  • Ghostdriver is not finding some of our selectors i.e. //div[] or div.some_class and we know the selectors are valid. I want to see if there is a bug in ghostdriver. I was thinking maybe it's a page load issue, like the page doesn't load some of the elements on the page. – user1941192 Aug 05 '15 at 08:14
  • I see. I haven't yet experienced problems with XPath expressions in PhantomJS, but there is a `:nth-child()`/`:nth-of-type()` bug in PhantomJS 1.x. Make sure that the element is actually there by taking a screenshot and printing the page source. – Artjom B. Aug 05 '15 at 08:52
  • We are using phantomjs 2.0.0. I need a way to debug the ghostdriver source code. – user1941192 Aug 05 '15 at 09:16

1 Answers1

0

For this you need to use not compiled libs, but source code of ghost driver. https://github.com/detro/ghostdriver

Not sure that this is possible from the python.(as looks like its written on java, but not sure)

Andrew_STOP_RU_WAR_IN_UA
  • 9,318
  • 5
  • 65
  • 101
  • Ghostdriver is written in JavaScript and it runs directly in PhantomJS. Theoretically it may be possible to change the ghostdriver implementation with one that enables debugging without recompiling PhantomJS. – Artjom B. Aug 04 '15 at 21:19
  • Any idea how I can do that? – user1941192 Aug 05 '15 at 19:48