question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

moveTo() throws exception due to floating value of newXOffset or newYOffset variables

See original GitHub issue

Environment (please complete the following information):

  • WebdriverIO version: 6.1.16
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 12.16.3
  • NPM version: 6.14.4
  • Browser name and version: Chrome 83.0.4103.116
  • Platform name and version: Windows 10

Config of WebdriverIO An example of how you configured WebdriverIO config

Describe the bug When passing the float value for options.xOffset and/or options.yOffset, the function throws exception

Reason While calculating newXOffset or newYOffset, the parseInt() has been applied before subtracting the scrollX or scrollY respectively which might again result in float if the value of scrollX or scrollY is float. Problem at L28 in moveTo.js

To Reproduce Provide options.xOffset and/or options.yOffset in moveTo() such that the const scrollX and/or const scrollY variables in moveTo() are of type float

Expected behavior options.x and/or options.y must allow float without error as the expected type is Number as per the official documentation

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
christian-bromanncommented, Jul 7, 2020

@monil20 it has not been fixed yet. I closed the issue because we have a PR for it. Please follow #5572 for updates.

1reaction
christian-bromanncommented, Jul 6, 2020

Will close this issue as an PR is already provided in #5572.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the use of integer variables throw an exception?
The short answer. Integral types (JLS 4.2.1) are categorically different from floating point types (JLS 4.2.3). There may be similarities in ...
Read more >
DivideByZeroException Class (System) - Microsoft Learn
Dividing a floating-point value by zero doesn't throw an exception; it results in positive infinity, negative infinity, or not a number (NaN), according...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found