GhostDriver is written in JavaScript and it uses the PhantomJS API to translate WebDriver wire protocol commands into native PhantomJS commands/calls.
PhantomJS has two contexts: the outer (phantom) context to drive the browser and the inner (page) context where the page JavaScript is executed. If you disable JavaScript in PhantomJS, only the page context is disabled. You can still do some things, but you cannot use page.evaluate*()
anymore which is the door into the page context. If you look closely into the PhantomJS API, you see that there are no functions that can be used to access the DOM. This means that you cannot find an element, you cannot query for the text of an element, you cannot change an element and you cannot know where an element is to click on it.
All you can do, is creating screenshots (page.render()
) and blindly clicking and typing (page.sendEvent()
). This is not enough for the WebDriver protocol to work.