问题
I want to know difference between Selenium Webdriver and Selenium Ghostdriver.
I am also confused as to why selenium Ghostdriver is used?
Please give me a brief idea.
Thanks in Advance.
回答1:
Selenium WebDriver is made up of core Java API and it is also known as Selenium 2
Ghost Driver is a pure JavaScript implementation of the WebDriver Wire Protocol for PhantomJS. It's a Remote WebDriver that uses PhantomJS as back-end.
WebDriver
Implementation for PhantomJs
is GhostDriver
The Selenium2
driver actually loads and runs an active browser session, manipulating the browser just as a human would. ZombieJS
is a 'headless' browser that provides all of the features of a regular browser, but without a display interface. Without the extra time spent waiting for the display to actually render, a headless browser like ZombieJS
can run far faster than a normal browser, so you're tests will execute in as little as half the time. But ZombieJS requires installing Node.js and can be a little buggy, plus it has its own API (which has both pros and cons). The Selenium2 driver is well tested and implements a standard API -- the WebDriver Wire Protoco
l -- across all of the browsers it has drivers for.
Now there's a headless browser that includes a WebDriver Wire Protocol implementation -- PhantomJS
. The latest version of PhantomJS is an easy to install, stand-alone binary that doesn't require installing Node.js or any other dependencies, and ships with its own 'Ghost Driver
' for implementing the WebDriver Wire Protocol. Which means you can drive it using the Selenium2 driver in Codeception, and anything that you can test in Chrome, Firefox, Safari, or IE using Selenium2, you can now test in half the time using PhantomJS
Even though it's not needed to run the most recent PhantomJS, it's a good idea to have Selenium2 installed so you can test in other browsers.
来源:https://stackoverflow.com/questions/33074133/what-is-the-difference-between-selenium-webdriver-and-selenium-ghostdriver