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.

java.util.HashMap cannot be cast to org.openqa.selenium.WebElement

See original GitHub issue

Description

@SrinivasanTarget @mykola-mokhnach @TikhomirovSergey @jlipps @saikrishna321

Once appium starts up and begins to find and use element id’s in the mobile app, an error is thrown:

org.openqa.selenium.WebDriverException: Returned value cannot be converted to WebElement: {ELEMENT=1}
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.openqa.selenium.WebElement

Appium Log files: https://gist.github.com/telangn

Environment

Ubuntu 16 OS

<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>3.4.0</version>
		</dependency>
		<dependency>
			<groupId>io.appium</groupId>
			<artifactId>java-client</artifactId>
			<version>6.0.0-BETA2</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-java</artifactId>
			<version>1.2.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-picocontainer</artifactId>
			<version>1.2.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-junit</artifactId>
			<version>1.2.5</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

Details

GIST for appium log files:

https://gist.github.com/telangn

Link to Appium logs

https://gist.github.com/telangn

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

3reactions
telangncommented, Nov 19, 2018

@otaviolandim @tutkuefe Sorry for the late reply. Interesting, I looked at my POM and besides Cucumber and JUnit libraries, this is all I have. <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>6.0.0</version> </dependency>

0reactions
mahima-raniumcommented, Mar 4, 2019

Thanks for your answer it helped me @telangn

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.util.HashMap cannot be cast to org.openqa.selenium ...
Exception in thread "main" java.lang.ClassCastException: java.util.HashMap cannot be cast to org.openqa.selenium.WebElement.
Read more >
java.util.HashMap cannot be cast to org.openqa.selenium ...
Just installed Katalon 5.7.1 using this tutorial . Started with Example project for mobile. Both exa…
Read more >
Selenium error: java.util.HashMap cannot be cast to java.util.List
Following is the documentation for the execute method: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidexecute.
Read more >
java.util.HashMap cannot be cast to org ... - Appium Discuss
How do I resolve this issue Returned value cannot be converted to WebElement java.util.HashMap cannot be cast to org.openqa.selenium.
Read more >
【iOS】java.lang.ClassCastException: java.util.HashMap cannot be ...
【iOS】java.lang.ClassCastException: java.util.HashMap cannot be cast to org.openqa.selenium.WebElement #10098.
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