GhostDriver, a JavaScript-based tool, utilizes the PhantomJS API to interpret WebDriver wire protocol commands into native PhantomJS commands/calls.
In PhantomJS, there are two distinct contexts: the outer (phantom) context for controlling the browser and the inner (page) context where page JavaScript is run. Disabling JavaScript in PhantomJS only affects the page context, limiting functionality such as page.evaluate*()
, which accesses the page context. The lack of DOM-related functions in the PhantomJS API means you cannot interact with elements on the page - no element location, text retrieval, modification, or clicking capabilities.
The only actions available are capturing screenshots (page.render()
) and blind clicking/typing (page.sendEvent()
), which fall short of meeting the requirements of the WebDriver protocol.