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

[Java] Convert RemoteWebElement::getLocation and ::getSize from JWP Standard to W3C Standard #10700

Merged
merged 4 commits into from
May 27, 2022

Conversation

BJap
Copy link
Contributor

@BJap BJap commented May 26, 2022

Fixes #10698 as part of #10374

This switches two commands that were left over from JWP (which is no longer supported) to use a W3C command instead and achieve the same result.

Description

GET_ELEMENT_LOCATION and GET_ELEMENT_SIZE have been changed to GET_ELEMENT_RECT inside the respective getLocation and getSize functions of RemoteWebElement

Motivation and Context

Anyone running tests in W3C mode will not be able to use these functions as they will throw an exception for trying to use invalid commands.

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.

@CLAassistant
Copy link

CLAassistant commented May 26, 2022

CLA assistant check
All committers have signed the CLA.

titusfortner
titusfortner previously approved these changes May 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2022

Codecov Report

Merging #10700 (8df9f7f) into trunk (c0d25bc) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            trunk   #10700   +/-   ##
=======================================
  Coverage   46.64%   46.64%           
=======================================
  Files          86       86           
  Lines        5855     5855           
  Branches      278      278           
=======================================
  Hits         2731     2731           
  Misses       2846     2846           
  Partials      278      278           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0d25bc...8df9f7f. Read the comment docs.

@diemol
Copy link
Member

diemol commented May 27, 2022

RemoteWebElementTest unit tests are failing.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @BJap!

@diemol diemol merged commit eda884a into SeleniumHQ:trunk May 27, 2022
@BJap
Copy link
Contributor Author

BJap commented May 27, 2022

@diemol For sure and thanks! I waited a bit and didn't see anything pop up for me to see to fix, or a means to import and run tests documented but thanks for catching that as well.

I think also as part of #10374 there's constants related to this PR's old commands that could be removed, maybe JsonHttpCommandCodec and W3CHttpCommandCodec or ProtocolConverter and some unit tests like ProtocolConverterTest. I am unsure of the details of this ticket but wanted to reference those in case, as part of the work, and let the team handle how they want to do that.

@BJap BJap deleted the webelement-rect-w3c branch May 27, 2022 17:42
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
…tandard to W3C Standard (SeleniumHQ#10700)

* [Java] Convert RemoteWebElement::getLocation and ::getSize from JWP Standard to W3C Standard

Fixes SeleniumHQ#10698 as part of SeleniumHQ#10374

* [java] Fixing RemoteWebElementTest unit tests

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
Co-authored-by: Diego Molina <diemol@gmail.com>

[skip ci]
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.

[🐛 Bug]: (Java) S3-S4 W3C Mode Not Supported Using RemoteWebElement to getLocation and getSize
5 participants