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

Android: Getting BatteryInfo gives Error. #1039

Closed
WasiqB opened this issue Oct 5, 2018 · 3 comments
Closed

Android: Getting BatteryInfo gives Error. #1039

WasiqB opened this issue Oct 5, 2018 · 3 comments

Comments

@WasiqB
Copy link
Contributor

WasiqB commented Oct 5, 2018

Description

Please describe the issue. It may be a bug description. So then please briefly descride steps which you were trying to perform and what happened instead.
If there is the feature you want to see added to Appium Java client so please describe necessity of this feature and the way that it should work.

Environment

  • java client build version or git revision if you use some shapshot: 6.1.0
  • Appium server version or git revision if you use some shapshot: 1.9.1
  • Desktop OS/version used to run Appium if necessary: Linux Ubuntu 16.0.4
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:8.12.0 / 1.7.1
  • Mobile platform/version under test: Android 7.0
  • Real device or emulator/simulator: Real device

Details

When trying to get Battery Info for the device, an error is generated.

Code To Reproduce Issue [ Good To Have ]

	AndroidDriver <AndroidElement> driver = new AndroidDriver <> (new URL ("http://0.0.0.0:4723/wd/hub"), caps);
	BatteryState batteryInfo = driver.getBatteryInfo().getState();
	System.out.println(batteryInfo);

Exception stacktraces

Appium Java client exception and Appium server logs can be found here: https://gist.github.com/WasiqB/4de519dd22d72ae4907c0063c3513dfa

@mykola-mokhnach
Copy link
Contributor

This endpoint is only available with UIAutomator2

@WasiqB
Copy link
Contributor Author

WasiqB commented Oct 6, 2018

What happens in case of iOS? Is Battery info supported for iOS only in XCUITest driver?

@dmlemeshko
Copy link

@WasiqB You can find the answer in official docs

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

No branches or pull requests

3 participants