Skip to content
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

[🚀 Feature]: se:recordVideo should be used to determine if video should be recorded #2090

Closed
eugenek5 opened this issue Jan 11, 2024 · 5 comments · Fixed by #2104
Closed

Comments

@eugenek5
Copy link

eugenek5 commented Jan 11, 2024

Feature and motivation

By documentation for docker based Grid, it is stated that on setting se:recordVideo to true the grid should record a video, and inversely I understood that setting it to false should not record that session.

Feature proposal to use the recordVideo flag as a parameter on Deployment and Job pods - video sidecar container to determine if we should record and upload the session.

This will bring the k8s Helm deployed grid to feature parity.

To record the WebDriver session, users would need to add a se:recordVideo field set to True. False or not set would not record the video. We can also add a default false or default true override if we want to preserve a default video recording or default no recording behavior.

In the Video sidecar container the script /opt/bin/video.sh is constantly running and only checking if a session begins to start recording

while curl -s --request GET http://localhost:5555/status > /tmp/status.json
do
    session_id=$(jq -r '.[]?.node?.slots | .[0]?.session?.sessionId' /tmp/status.json)
    echo $session_id
    if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]]

I believe there should be an additional query to the GraphQL endpoint to check browser compatibilities

curl -X POST -H "Content-Type: application/json" --data '{"query":"{ session (id: \"<session-id>\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' -s <LINK_TO_GRAPHQL_ENDPOINT>

parsing capabilities will reveal the requested tags including se:recordVideo

{
  "data": {
    "sessionsInfo": {
      "sessions": [
        {
          "id": "38047fee2791262004330c3131904a2f",
          "capabilities": "{\n  \"acceptInsecureCerts\": false,\n  \"browserName\": \"chrome\",\n  \"browserVersion\": \"120.0.6099.109\",\n  \"chrome\": {\n    \"chromedriverVersion\": \"120.0.6099.109 (34191
40ab665596f21b385ce136419fde0924272-refs\\u002fbranch-heads\\u002f6099@{#1483})\",\n    \"userDataDir\": \"\\u002ftmp\\u002f.org.chromium.Chromium.xqUtVT\"\n  },\n  \"fedcm:accounts\": true,\n  \"goog:chromeOp
tions\": {\n    \"debuggerAddress\": \"localhost:45553\"\n  },\n  \"networkConnectionEnabled\": false,\n  \"pageLoadStrategy\": \"normal\",\n  \"platformName\": \"linux\",\n  \"proxy\": {\n  },\n  \"se:bidiEna
bled\": false,\n  \"se:cdp\": \"wss:\\u002f\\u002fadmin:[email protected]\\u002fgrid-qa\\u002fsession\\u002f38047fee2791262004330c3131904a2f\\u002fse\\u002fcdp\",\n  \"se:cdpVersion\": \"120.0.6099.10
9\",\n  \"se:recordVideo\": \"false\",\n  \"se:vnc\": \"wss:\\u002f\\u002fadmin:[email protected]\\u002fgrid-qa\\u002fsession\\u002f38047fee2791262004330c3131904a2f\\u002fse\\u002fvnc\",\n  \"se:vncEn
abled\": true,\n  \"se:vncLocalAddress\": \"ws:\\u002f\\u002f10.254.36.194:7900\",\n  \"setWindowRect\": true,\n  \"strictFileInteractability\": false,\n  \"timeouts\": {\n    \"implicit\": 0,\n    \"pageLoad\
": 300000,\n    \"script\": 30000\n  },\n  \"unhandledPromptBehavior\": \"dismiss and notify\",\n  \"webauthn:extension:credBlob\": true,\n  \"webauthn:extension:largeBlob\": true,\n  \"webauthn:extension:minP
inLength\": true,\n  \"webauthn:extension:prf\": true,\n  \"webauthn:virtualAuthenticators\": true\n}",
          "startTime": "08\u002f01\u002f2024 05:37:45",
          "uri": "http:\u002f\u002f10.254.36.194:5555",
          "nodeId": "9172aba1-c457-4568-96d1-b6f4b04702e8",
          "sessionDurationMillis": "1189"
        }
      ]
    }
  }

In this example it shows "se:recordVideo":"false", which should be parsed and used as part of the video.sh logic to determine if we should start recording video or loop until the next session begins.

Usage example

Grid defaults to video recording false, passing se:recordVideo field set to True would record the video.

Inversely we can default Grid to always record videos and passing se:recordVideo field set to False would override and not record video.

Copy link

@eugenek5, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

Copy link

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

@VietND96
Copy link
Member

I will try to solve this in part of #2097

@VietND96
Copy link
Member

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants