What is the mechanism used for communication between webdriver and browser
Anyone can explain how the communication between the browser and the web driver happens ?. How does the webdriver object read and identify html elements in the browser? What is the relationship between the webdriver object and the browser for, and how to build the relationship browser and the webdriver object?
driver = new FirefoxDriver();
driver.findElements(By.id("element"));
source to share
Communication between webdriver and browser takes place via json-wire protocol, which is specified in W3C documentation . All browsers supported by webdriver use this same protocol.
How does webdriver read and identify elements on a page? It depends on the browser and browser.
Firefox - webdriver is installed as a plugin in your browser when you run the test. The webdriver server will send json commands to this plugin and these commands will be executed in the browser. The plugin is embedded in the webdriver jar file. It will be installed during test execution.
Chrome . To test chrome, you will also need the chromedriver.exe file. This chromedriver.exe is similar to the firefox plugin. It can receive commands from the webdriver server and execute it in the browser
IE . Similar to Chrome, IE is executed using InternetExplorerDriver.exe.
You can learn more about the functionality by looking at the other DriverFile source code on github .
You can also get an idea of ββthe work from here - http://www.aosabook.org/en/selenium.html . I'm not sure how updated this page is, but should help you understand the concept.
source to share