Swipe needs long value while sometimes I get float
See original GitHub issueGiven x, y in float type When I do swipe Then I will get below error
WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException:
Expected a long but was 1274.6 at line 1 column 60 path $.actions[0].options.y at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:306) at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:296) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) at com.google.gson.Gson.fromJson(Gson.java:922) at com.google.gson.Gson.fromJson(Gson.java:887) at com.google.gson.Gson.fromJson(Gson.java:836) at com.google.gson.Gson.fromJson(Gson.java:808) at io.appium.espressoserver.lib.http.Router.route(Router.java:263) at io.appium.espressoserver.lib.http.Server.serve(Server.java:65) at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244) at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945) at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.NumberFormatException: Expected a long but was 1274.6 at line 1 column 60 path $.actions[0].options.y at com.google.gson.stream.JsonReader.nextLong(JsonReader.java:967) at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:304) ... 20 more
--
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
java - Why long literal can be assigned to float variable while ...
In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode ...
Read more >Animation | Jetpack Compose - Android Developers
If there's already an animation in flight, the animation starts from its current value (and velocity) and animates toward the target value. During...
Read more >Why Floating-Point Numbers May Lose Precision
Floating-point decimal values generally do not have an exact binary representation. This is a side effect of how the CPU represents floating ...
Read more >Float wants to provide liquidity to African SMBs in a way never ...
According to research, 85% of African SMBs have zero access to financing, and each day, African SMBs have billions locked up in receivables ......
Read more >Use the floating keyboard on your iPad - Apple Support
Then you can change the keyboard back to its full size. How to make your iPad keyboard smaller. Open an app that uses...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just put in a PR… we’re going to accept floats, but round the values.
So I found the root cause, when I add wait, it will throws error POST http://localhost:4798/wd/hub/session/8896d495-fbd2-457e-8ef5-47172a63b495/touch/perform Body
@dpgraham @mykola-mokhnach