Skip to content

[grid] Fix VNC caps not propagated for sessions without browserName#17235

Merged
VietND96 merged 1 commit into
trunkfrom
session-caps
Mar 18, 2026
Merged

[grid] Fix VNC caps not propagated for sessions without browserName#17235
VietND96 merged 1 commit into
trunkfrom
session-caps

Conversation

@VietND96

@VietND96 VietND96 commented Mar 18, 2026

Copy link
Copy Markdown
Member

🔗 Related Issues

💥 What does this PR do?

When a session request arrives without a browserName capability (e.g. {proxy: {proxyType: direct}}), the Grid routes it to any matching slot, but the resulting session capabilities are missing se:vnc and se:vncLocalAddress.
So the live preview icon is not visible on the Grid UI.

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)
  • New feature (non-breaking change which adds functionality and tests!)
  • Breaking change (fix or feature that would cause existing functionality to change)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix VNC capabilities propagation for browserName-less sessions

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fix VNC capabilities not propagated for sessions without browserName
• Move browserName check after VNC capability propagation
• Add test case for proxy-only capability requests

Grey Divider

File Changes

1. java/src/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutator.java 🐞 Bug fix +7/-4

Reorder capability propagation logic for VNC support

• Removed early return when browserName doesn't match stereotype
• Moved browserName validation after VNC capability propagation
• Added clarifying comment explaining VNC propagation logic
• Ensures VNC capabilities are always propagated regardless of browserName presence

java/src/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutator.java


2. java/test/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutatorTest.java 🧪 Tests +20/-0

Add test for VNC caps without browserName

• Added new test case for proxy-only capability requests
• Verifies VNC capabilities are present when browserName is absent
• Tests scenario where session has no browserName but slot has VNC enabled

java/test/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutatorTest.java


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@selenium-ci selenium-ci added B-grid Everything grid and server related C-java Java Bindings labels Mar 18, 2026
@VietND96 VietND96 merged commit 458c350 into trunk Mar 18, 2026
30 checks passed
@VietND96 VietND96 deleted the session-caps branch March 18, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-grid Everything grid and server related C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants