Did you ever wonder how Selenium 2.0 works internally?
In this post, you will get to know how selenium automates the browser.
Selenium API sends HTTP commands in the form of JSON protocol to Selenium Server.
Selenium server then uses native browser API to automate the browser.
So when use below statement in your code -
It actually sends the below HTTP command to the selenium server.
POST /session
For each selenium API method, there is a corresponding HTTP request that is sent to the server. Here is the list of some of the HTTP commands that are sent to Selenium Server.
In this post, you will get to know how selenium automates the browser.
Selenium API sends HTTP commands in the form of JSON protocol to Selenium Server.
Selenium server then uses native browser API to automate the browser.
So when use below statement in your code -
driver = new ChromeDriver();
It actually sends the below HTTP command to the selenium server.
POST /session
For each selenium API method, there is a corresponding HTTP request that is sent to the server. Here is the list of some of the HTTP commands that are sent to Selenium Server.
- POST /session - Create new session
- GET /status - Get the state of server
- DELETE /session/:sessionId - Delete the session with id - sessionId
- POST /session/:sessionId/timeouts/implicit_wait - Specify the amount of time the driver should wait when searching for elements.
- GET /session/:sessionId/url - Navigate to the specific url
Below image demonstrates how the JSON protocol works in Selenium.
More information at below links -
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
Excellent
ReplyDelete