Selenium Webdriver和Selenium Ghostdriver有什么区别? [英] What is the Difference between Selenium Webdriver and Selenium Ghostdriver?

查看:155
本文介绍了Selenium Webdriver和Selenium Ghostdriver有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Selenium Webdriver和Selenium Ghostdriver之间的区别.

I want to know difference between Selenium Webdriver and Selenium Ghostdriver.

对于为什么使用硒Ghostdriver,我也感到困惑.

I am also confused as to why selenium Ghostdriver is used?

请给我一个简短的想法.

Please give me a brief idea.

预先感谢.

推荐答案

Selenium WebDriver由核心Java API组成,也称为Selenium 2

Selenium WebDriver is made up of core Java API and it is also known as Selenium 2

Ghost驱动程序是用于PhantomJS的WebDriver Wire Protocol的纯JavaScript实现.这是一个使用PhantomJS作为后端的远程WebDriver.

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 PhantomJs的实现是GhostDriver

Selenium2驱动程序实际上加载并运行一个活动的浏览器会话,从而像人工操作浏览器一样进行操作. ZombieJS是无头"浏览器,提供常规浏览器的所有功能,但没有显示界面.无需花费额外的时间等待显示器真正呈现,无头浏览器(如ZombieJS)的运行速度将比普通浏览器快得多,因此您的测试将在短时间内完成.但是ZombieJS需要安装Node.js,并且可能会出现一些小问题,此外它还具有自己的API(既有优点也有缺点). Selenium2驱动程序经过了良好的测试,并在其具有驱动程序的所有浏览器中实现标准API-WebDriver Wire Protoco l.

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 Protocol -- across all of the browsers it has drivers for.

现在有一个无头浏览器,其中包含WebDriver Wire Protocol实现-PhantomJS. PhantomJS的最新版本是易于安装的独立二进制文件,不需要安装Node.js或任何其他依赖项,并且附带有自己的"Ghost Driver"来实现WebDriver Wire Protocol.这意味着您可以使用Codeception中的Selenium2驱动程序来驱动它,以及可以使用Selenium2在Chrome,Firefox,Safari或IE中测试的任何东西,现在您可以使用PhantomJS进行一半的测试

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

即使不需要运行最新的PhantomJS,也最好安装Selenium2,以便您可以在其他浏览器中进行测试.

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.

这篇关于Selenium Webdriver和Selenium Ghostdriver有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆