简体   繁体   中英

how WebDriver driver = new FirefoxDriver() works internally?

I am curious to know how "new FirefoxDriver();" launch a Mozilla browser. What happen behind the scene.

As per my understanding , there is a FireFox class ,which implements Webdriver interface. By doing new FirefoxDriver() , JVM will search for this class to load . But how does this connect to mozilla.exe installed in my system ?

Firefox driver is included in the selenium-server-stanalone.jar available in the downloads. The driver comes in the form of an xpi (firefox extension) which is added to the firefox profile when you start a new instance of FirefoxDriver.

See this

The FirefoxDriver is largely written in the form of a Firefox extension. Language bindings control the driver by connecting over a socket and sending commands (described in the JsonWireProtocol page) in UTF-8. The extension makes use of the XPCOM primitives offered by Firefox in order to do its work. The important thing to notice is that the command names map directly on to methods exposed on the "FirefoxDriver.prototype" in the javascript code.

This link may help, https://code.google.com/p/selenium/wiki/FirefoxDriverInternals

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM