SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

org.openqa.selenium.WebDriverException: java.lang.Double cannot be cast to java.lang.Long #6980

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 6980

Point l_xy = p_element.getLocation();
p_elemetn is WebElement.
It fails sometimes - it depends how webElement is big.
I am using selenium-server-standalone-2.39.0.jar and android-server-2.38.0.apk on Andorid4.2
VM in VirtualBox.

Expected behavior is that location is stored into l_xy.

Selenium version: selenium-server-standalone-2.39.0.jar and android-server-2.38.0.apk
OS: Windows 7 64bit and Andorid 4.2
Browser: Android native
Browser version: Android native

I think it is coused by methods getLocation.
http://grepcode.com/file/repo1.maven.org/maven2/org.seleniumhq.selenium/selenium-android-driver/2.32.0/org/openqa/selenium/android/library/AndroidWebElement.java#AndroidWebElement.getLocation%28%29

https://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/remote/RemoteWebElement.java

When in AndroidWebElement.getLocation is defined map with Long:
 Map<String, Long> map = (Map<String, Long>)

Exception:
org.openqa.selenium.WebDriverException: java.lang.Double cannot be cast to java.lang.Long
Command duration or timeout: 53 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'PC-msupol', ip: '10.51.121.76', os.name: 'Windows 7', os.arch:
'amd64', os.version: '6.1', java.version: '1.7.0_03'
Session ID: 455c8ebe-8a4d-4209-830c-46e27c6b019e
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=ANDROID, javascriptEnabled=true, acceptSslCerts=true, browserName=android,
rotatable=true, locationContextEnabled=true, webdriver.remote.sessionid=455c8ebe-8a4d-4209-830c-46e27c6b019e,
version=17, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true,
hasTouchScreen=true, applicationCacheEnabled=true, takesScreenshot=true}]

Stack trace is in attachment.

Reported by supolm on 2014-02-12 12:47:15


lukeis commented 8 years ago
AndroidWebDriver is deprecated, use Appium [1] or Selendroid [2] instead.

[1] http://appium.io/
[2] http://selendroid.io/

Reported by barancev on 2014-02-12 13:37:09

lukeis commented 8 years ago
I know, but still is possible create RemoteWebDriver for Android and use that apk for
Android. That apk will be also deprecated?

Reported by supolm on 2014-02-12 14:12:05

lukeis commented 8 years ago
Yes, all parts are deprecated.

Reported by barancev on 2014-02-12 14:23:37

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:22:06