0 votes
in Selenium by
How does a Selenium WebDriver interact with the browser?

1 Answer

0 votes
by

On a high level, the Selenium webdriver communicates with the browser and does not transform commands into JavaScript. Our Java or Python code will be transmitted as an API get and post request in the JSON wire protocol. The browser webdriver interacts with the real browser as an HTTP Request, as mentioned in the previous answer. To receive HTTP requests, each Browser Driver utilizes an HTTP server. When the URL reaches the Browser Driver, it will send the request via HTTP to the real browser. The commands in your Selenium script will be executed on the browser after this is completed.

If the request is a POST request, the browser will perform an action. If the request is a GET request, the browser will generate the corresponding response. The request will then be delivered to the browser driver through HTTP, and the browser driver will send it to the user interface via JSON Wire Protocol. Learn More.

The JSON wire protocol converts test commands into HTTP requests.

Every browser has its own driver that initializes the server before executing any test cases.

The browser's driver then begins to receive the request.

Related questions

+1 vote
asked Jan 7 in Selenium by SakshiSharma
0 votes
asked Aug 22, 2019 in Selenium by john ganales
...