Skip to content

Add browsername capabilities to Grid - #8449

Merged
shs96c merged 7 commits into
SeleniumHQ:masterfrom
shucon:capabilities
Jun 24, 2020
Merged

Add browsername capabilities to Grid#8449
shs96c merged 7 commits into
SeleniumHQ:masterfrom
shucon:capabilities

Conversation

@shucon

@shucon shucon commented Jun 22, 2020

Copy link
Copy Markdown
Contributor

Partial-PR: #8020

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shucon

shucon commented Jun 23, 2020

Copy link
Copy Markdown
Contributor Author

@shs96c @AutomatedTester

@shs96c shs96c left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "stereotype" is used when taking an incoming new session request to figure out which slot may be able to help. Because of this, it should be pretty minimal. Why? Because the local end (the RemoteWebDriver) tend to just ask for a particular browser name. As such, because everything added to the canonical/stereotypical capabilities MUST be matched in the request coming from the local end, you'll end up with a lot more failures when creating sessions.

Comment thread java/client/src/org/openqa/selenium/chrome/ChromeDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/edge/EdgeDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/edgehtml/EdgeHtmlDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/firefox/GeckoDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/safari/SafariDriverInfo.java Outdated
Comment thread java/client/src/org/openqa/selenium/safari/SafariTechPreviewDriverInfo.java Outdated
Comment thread java/server/src/org/openqa/selenium/grid/graphql/Grid.java Outdated
Comment thread java/server/src/org/openqa/selenium/grid/graphql/Node.java Outdated
this.uri = Require.nonNull("Node uri", uri);
this.isUp = isUp;
this.maxSession = Require.nonNull("Node maxSession", maxSession);
this.capabilities = Require.nonNull("Node capabilities", capabilities.toString());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to convert this to a JSON blob rather than the string representation of a java datastructure.

@shucon
shucon requested a review from shs96c June 24, 2020 09:09

@shs96c shs96c left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the nit is addressed, this LGTM

this.uri = Require.nonNull("Node uri", uri);
this.isUp = isUp;
this.maxSession = Require.nonNull("Node maxSession", maxSession);
this.capabilities = Require.nonNull("Node capabilities", new Json().toJson(capabilities));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Make this a private constant in the class, as some of the state picked up by reflection is stored.

@shs96c
shs96c merged commit 8ea8077 into SeleniumHQ:master Jun 24, 2020
@shs96c

shs96c commented Jun 24, 2020

Copy link
Copy Markdown
Member

OK. This looks good. Thank you!

titusfortner pushed a commit to titusfortner/selenium that referenced this pull request Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants