
- Selenium - Home
- Selenium - Overview
- Selenium - Components
- Selenium - Automation Testing
- Selenium - Environment Setup
- Selenium - Remote Control
- Selenium - IDE Introduction
- Selenium - Features
- Selenium - Limitations
- Selenium - Installation
- Selenium - Creating Tests
- Selenium - Creating Script
- Selenium - Control Flow
- Selenium - Store Variables
- Selenium - Alerts & Popups
- Selenium - Selenese Commands
- Selenium - Actions Commands
- Selenium - Accessors Commands
- Selenium - Assertions Commands
- Selenium - Assert/Verify Methods
- Selenium - Locating Strategies
- Selenium - Script Debugging
- Selenium - Verification Points
- Selenium - Pattern Matching
- Selenium - JSON Data File
- Selenium - Browser Execution
- Selenium - User Extensions
- Selenium - Code Export
- Selenium - Emitting Code
- Selenium - JavaScript Functions
- Selenium - Plugins
- Selenium WebDriver Tutorial
- Selenium - Introduction
- Selenium WebDriver vs RC
- Selenium - Installation
- Selenium - First Test Script
- Selenium - Driver Sessions
- Selenium - Browser Options
- Selenium - Chrome Options
- Selenium - Edge Options
- Selenium - Firefox Options
- Selenium - Safari Options
- Selenium - Double Click
- Selenium - Right Click
- HTML Report in Python
- Handling Edit Boxes
- Selenium - Single Elements
- Selenium - Multiple Elements
- Selenium Web Elements
- Selenium - File Upload
- Selenium - Locator Strategies
- Selenium - Relative Locators
- Selenium - Finders
- Selenium - Find All Links
- Selenium - User Interactions
- Selenium - WebElement Commands
- Selenium - Browser Interactions
- Selenium - Browser Commands
- Selenium - Browser Navigation
- Selenium - Alerts & Popups
- Selenium - Handling Forms
- Selenium - Windows and Tabs
- Selenium - Handling Links
- Selenium - Input Boxes
- Selenium - Radio Button
- Selenium - Checkboxes
- Selenium - Dropdown Box
- Selenium - Handling IFrames
- Selenium - Handling Cookies
- Selenium - Date Time Picker
- Selenium - Dynamic Web Tables
- Selenium - Actions Class
- Selenium - Action Class
- Selenium - Keyboard Events
- Selenium - Key Up/Down
- Selenium - Copy and Paste
- Selenium - Handle Special Keys
- Selenium - Mouse Events
- Selenium - Drag and Drop
- Selenium - Pen Events
- Selenium - Scroll Operations
- Selenium - Waiting Strategies
- Selenium - Explicit/Implicit Wait
- Selenium - Support Features
- Selenium - Multi Select
- Selenium - Wait Support
- Selenium - Select Support
- Selenium - Color Support
- Selenium - ThreadGuard
- Selenium - Errors & Logging
- Selenium - Exception Handling
- Selenium - Miscellaneous
- Selenium - Handling Ajax Calls
- Selenium - JSON Data File
- Selenium - CSV Data File
- Selenium - Excel Data File
- Selenium - Cross Browser Testing
- Selenium - Multi Browser Testing
- Selenium - Multi Windows Testing
- Selenium - JavaScript Executor
- Selenium - Headless Execution
- Selenium - Capture Screenshots
- Selenium - Capture Videos
- Selenium - Page Object Model
- Selenium - Page Factory
- Selenium - Record & Playback
- Selenium - Frameworks
- Selenium - Browsing Context
- Selenium - DevTools
- Selenium Grid Tutorial
- Selenium - Overview
- Selenium - Architecture
- Selenium - Components
- Selenium - Configuration
- Selenium - Create Test Script
- Selenium - Test Execution
- Selenium - Endpoints
- Selenium - Customizing a Node
- Selenium Reporting Tools
- Selenium - Reporting Tools
- Selenium - TestNG
- Selenium - JUnit
- Selenium - Allure
- Selenium & other Technologies
- Selenium - Java Tutorial
- Selenium - Python Tutorial
- Selenium - C# Tutorial
- Selenium - Javascript Tutorial
- Selenium - Kotlin Tutorial
- Selenium - Ruby Tutorial
- Selenium - Maven & Jenkins
- Selenium - Database Testing
- Selenium - LogExpert Logging
- Selenium - Log4j Logging
- Selenium - Robot Framework
- Selenium - AutoIT
- Selenium - Flash Testing
- Selenium - Apache Ant
- Selenium - Github Tutorial
- Selenium - SoapUI
- Selenium - Cucumber
- Selenium - IntelliJ
- Selenium - XPath
- Selenium Miscellaneous Concepts
- Selenium - IE Driver
- Selenium - Automation Frameworks
- Selenium - Keyword Driven Framework
- Selenium - Data Driven Framework
- Selenium - Hybrid Driven Framework
- Selenium - SSL Certificate Error
- Selenium - Alternatives
Selenium Grid - Endpoints
The latest version of Selenium Grid 4, is developed without leveraging the code base of the older versions of the Selenium Grid. This latest version of Selenium Grid 4 version has some advanced features like the Grid endpoints.
The latest version of Selenium Grid allows test execution to be triggered in three different Selenium Grid modes. They are known as the Standalone, Hub and Nodes, and the Distributed.
Get Grid Status
The Grid status is used to provide details on the present condition of the Selenium Grid. The details include the information about all the registered nodes. For each individual node, the grid status tells if a node is available, and the sessions running on it along with the slot.
curl Get http://localhost:4444/status'
While the Selenium Grid is running in the Standalone mode, the Grid url points to the Standalone server address. In the Hub-Node mode, the Grid url points to the Hub server address and in the Distributed mode, the Grid url points to the Router server address.
In the above example, http://localhost:4444/status is the url used by default for all the modes mentioned above.
If there is a single Node, the Node url refers to http://localhost:5555.
The Node Status is used to measure the condition of the Node. The Distributor messages the node status at an interval and sends the same information to the Grid Model. This includes details about the availability, sessions, and slots.
cURL --request GET 'http://localhost:5555/status'
Remove Nodes From Selenium Grid
The curl command is used to remove a Node from the Selenium Grid. The removal of nodes from the Grid does not result in termination of any current session which is running in a Node. The session continues to execute unless it is specifically terminated. The Distributor does not have knowledge of Node and thus any similar new session request will not be forwarded to that specific Node.
While the Selenium Grid is running in the Standalone mode, the Distributor url refers to the Standalone server address. In the Hub-Node mode, the Distributor url refers to the Hub server address.
cURL --request DELETE 'http://localhost:4444/se/grid/distributor/node/<node-id>' --header 'X-REGISTRATION-SECRET: <secret> '
In the fully distributed mode, the url points to the Distributor server address.
cURL --request DELETE 'http://localhost:5553/se/grid/distributor/node/<node-id>' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, at that we have to use the below command −
cURL --request DELETE 'http://<Distributor-URL>/se/grid/distributor/node/<node-id>' --header 'X-REGISTRATION-SECRET;'
Drain Node in Selenium Grid
The Node drain command is used to perform a Node shut down in a proper way. Draining a node indicates putting an end to the Node post completion of all the active sessions. After that, no other new session requests are accepted.
While the Selenium Grid is running in the Standalone mode, the Distributor url refers to the Standalone server address. In the Hub-Node mode, the Distributor url refers to the Hub server address.
cURL --request POST 'http://localhost:4444/se/grid/distributor/node/<node-id>/drain' --header 'X-REGISTRATION-SECRET: <secret> '
In the fully distributed mode, the url points to the Distributor server address.
cURL --request POST 'http://localhost:5553/se/grid/distributor/node/<node-id>/drain' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, for that we have to use the below command −
cURL --request POST 'http://<Distributor-URL>/se/grid/distributor/node/<node-id>/drain' --header 'X-REGISTRATION-SECRET;'
Why Drain Command Used in Selenium Grid
The Distributor sends the drain command to the proper node with the help of the node id. In order to drain the Node by a direct route the below commands are used −
cURL --request POST 'http://localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, for that we have to use the below command −
cURL --request POST 'http://<node-URL>/se/grid/node/drain' --header 'X-REGISTRATION-SECRET;'
The endpoints used for the above commands are correct and yield the same results. Drain completes the active sessions prior to terminating the Node.
Check Session Owner in Selenium Grid
To check which session is a part of which Node, the below curl command is used −
cURL --request GET 'http://localhost:5555/se/grid/node/owner/<session-id>' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, for that we have to use the below command −
cURL --request GET 'http://<node-URL>/se/grid/node/owner/<session-id>' --header 'X-REGISTRATION-SECRET;'
Both the above commands will return true value, provided a particular session points to a Node, else false will be returned.
Delete Session in Selenium Grid
A webdriver session ends when a session is deleted. At this point, the driver is quitted, and separated from mapping of the active sessions. If any further request is processed or reused with the removed session id, the driver object shall give an error. The curl command to delete a session is −
cURL --request DELETE 'http://localhost:5555/se/grid/node/session/<session-id>' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, for that we have to use the below command −
cURL --request DELETE 'http://<node-URL>/se/grid/node/session/<session-id>' --header 'X-REGISTRATION-SECRET;'
Clear New Session Queue in Selenium Grid
The New Session Queue stores the new session requests. To wipe out the queue, the below curl command is used. Once a queue is cleared, all the other requests in the queue are not accepted any more and the server gives an error response to its client.
While the Selenium Grid is running in the Standalone mode, the Queue url points to the Standalone server address. In the Hub-Node mode, the Queue url points to the Hub server address.
cURL --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: <secret>'
In the properly Distributed mode, the Queue url points to the New Session Queue Server address.
cURL --request DELETE \'http://localhost:5559/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: <secret>'
If the configuration for the registration secret is not done, for that we have to use the below command −
cURL --request DELETE 'http://<URL>/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET;'
Get New Session Requests in Selenium Grid
The New Session Requests store the new session request. To obtain the present request in the queue, the below curl command is used. This command will yield the total count of the request in the queue, and their payloads.
While the Selenium Grid is running in the Standalone mode, the Queue url points to the Standalone server address. In the Hub-Node mode, the Queue url points to the Hub server address.
cURL --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue'
In the properly Distributed mode, the Queue url points to the New Session Queue Server address.
cURL --request GET 'http://localhost:5559/se/grid/newsessionqueue/queue'
This concludes our comprehensive take on the tutorial on Selenium Grid - Endpoints. Weve started with describing how to get the Grid Status, how to remove a node, what is a Drain Node, what is a Drain command, how to check and delete a session owner, how to clear the New Session Queue, and how to get new Session Requests in Selenium Grid.
This equips you with in-depth knowledge of the Selenium Grid Endpoints. It is wise to keep practicing what youve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons.