Skip to content

Cache IWebElement before checking TagName is correct #8904

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

Merged
merged 2 commits into from
Nov 24, 2020
Merged

Cache IWebElement before checking TagName is correct #8904

merged 2 commits into from
Nov 24, 2020

Conversation

elgatov
Copy link
Contributor

@elgatov elgatov commented Nov 24, 2020

When creating a SelectElement we must first check the WrappedElement tag is select and throw a UnexpectedTagNameException otherwise.

Previously the WrappedElement was not cached so WebDriver API could be called up to three times: first to check the tag is not null, second to check it's value is select (ignoring case) and a third time as a parameter of UnexpectedTagNameException if any of the previous conditions failed.

Fixes #8899

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.

When creating a SelectElement we must first check the WrappedElement tag is select and throw a UnexpectedTagNameException otherwise.

Previously the WrappedElement was not cached so WebDriver API could be called up to three times: first to check the tag is not null, second to check it's value is select (ignoring case) and a third time as a parameter of UnexpectedTagNameException if any of the previous conditions failed.

Fixes #8899
@CLAassistant
Copy link

CLAassistant commented Nov 24, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ AutomatedTester
❌ elgato


elgato seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AutomatedTester AutomatedTester merged commit 44b7ba4 into SeleniumHQ:trunk Nov 24, 2020
pujagani pushed a commit to pujagani/selenium that referenced this pull request Nov 26, 2020
When creating a SelectElement we must first check the WrappedElement tag is select and throw a UnexpectedTagNameException otherwise.

Previously the WrappedElement was not cached so WebDriver API could be called up to three times: first to check the tag is not null, second to check it's value is select (ignoring case) and a third time as a parameter of UnexpectedTagNameException if any of the previous conditions failed.

Fixes SeleniumHQ#8899

Co-authored-by: elgato <[email protected]>
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.

Performance issue in SelectElement dotnet
3 participants