-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse capabilities from console #3
Comments
@nicolaiparlog - Thanks for reaching out. Yes we can include that for sure in the library.
So now you could do something like {
"nodes": [
{
"browsers": [
{
"browser": "safari",
"slots": {
"busy": 0,
"total": 1
}
},
{
"browser": "chrome",
"slots": {
"busy": 0,
"total": 5
}
},
{
"browser": "firefox",
"slots": {
"busy": 1,
"total": 5
}
}
],
"id": "http://192.168.1.6:23375"
}
],
"success": true
}
So now you could do something like {
"proxies": [
{
"id": "http://192.168.1.6:23375",
"remoteHost": "http://192.168.1.6:23375",
"sessions": {
"status": 0,
"value": [
{
"id": "a0cf95c1-446f-6749-afdd-b446546a9714",
"capabilities": {
"acceptInsecureCerts": false,
"browserName": "firefox",
"browserVersion": "61.0.1",
"moz:accessibilityChecks": false,
"moz:headless": false,
"moz:processID": 47184,
"moz:profile": "/var/folders/mj/81r6v7nn5lqgqgtfl18spfpw0000gn/T/rust_mozprofile.LHpIaGzYWGwZ",
"moz:useNonSpecCompliantPointerOrigin": false,
"moz:webdriverClick": true,
"pageLoadStrategy": "normal",
"platformName": "darwin",
"platformVersion": "17.7.0",
"rotatable": false,
"timeouts": {
"implicit": 0,
"pageLoad": 300000,
"script": 30000
}
}
}
]
}
}
],
"success": true
} Both these PRs are now part of Selenium 3.14 I have been planning on including support for both these end-points over the weekend. So let me know if you prefer this newer way of getting that information. |
Argh, that would've been much better and more stable than parsing the HTML. 🤣 Although, on my grid (running the selenium/hub:3.14.0-arsenic docker image)
(I remember trying that one out.) |
For the /api/sessions to work, you need to have atleast one active session
running. Can you please quickly check that ?
|
I started using Selenium only yesterday, so I'm still a noob. 😊 What's a session and how do I get one? |
You just need to point to the grid and try instantiating a new
RemoteWebDriver [ This is usually how you run a test case pointing to the
grid ]
Something like this:
https://github.com/RationaleEmotions/talk2grid/blob/master/src/test/java/com/rationaleemotions/GridApiAssistantTest.java#L37-L58
… |
Yes, that works and the proxies show up one after another (the tests don't run in parallel). But then I can't use that endpoint to create tests, so I'm limited to |
The end-point http://localhost:4444/grid/api/sessions is not meant to
create tests.
Its only intended to introspect into a grid and find out what tests are
currently running in the hub.
… |
In the course of setting up end-to-end tests for my application, I wanted to dynamically determine how many grid nodes there are, so I can run each test once for each node. Since there is no endpoint exposing that information, I ended up parsing the output of
/grid/console
. SeeSeleniumGrid::parseCapabilities
in this snippet (needs tests and documentation!).Would you be interested to include that functionality?
The text was updated successfully, but these errors were encountered: