Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning centerCreate selenium grid
The endpoint 'Create selenium grid' is used to create an environment of Selenium Grid type in Leapwork. After successful creation of Selenium Grid environment, the Id of the environment is returned in response.
The details of the created environment can be validated with the help of Get environment by id endpoint.
http://{controllerMachine}:{controllerPort}/api/v3/environments/create/seleniumgrid
Property | Type | Description | Comments |
---|---|---|---|
requestBody | application/json |
Unique identifiers for the Selenium Grid environment comprising following parameters:
|
Kindly refer the documentation for Environments for more details on the usage.
|
curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \
"Port": "4444", \
"HostName": "Remote Agent", \
"Title": "My Test Grid", \
"Description": "Selenium Grid", \
"UserProfile": "", \
"PlatformName": "Windows", \
"Browser": "Chrome", \
"Version": "latest"
}' 'http://{controllerMachine}:{controllerPort}/api/v3/enviroments/create/seleniumgrid'
$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
$requestBody = @'
{
"Port": "4444",,
"HostName": "Remote Agent",
"Title": "My Test Grid",
"Description": "Selenium Grid",
"UserProfile": "",
"PlatformName": "Windows",
"Browser": "Chrome",
"Version": "latest"
}
'@
Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v3/environments/create/seleniumgrid" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody
CreateEnvironmentResponse object:
{ "$id": "1", "EnvironmentId": "4d9c09fe-7ced-4494-8841-378491ebc899" } |
Field | Type | Description | Values |
---|---|---|---|
$id | String | ID of internal item(Folder/ Flow/Element etc.) | |
EnvironmentId | String | ID of the environment created |
Response Code
200 (OK)
404 (Not Found)
401 (Incorrect Access Key)
400 (Bad Request, asset not found)
500 (Internal Server Error)
©2024, Leapwork. All rights reserved.