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.

AttributeError: 'WebDriver' object has no attribute 'get_device_time'

See original GitHub issue

The problem

When I tried to use driver.get_device_time() method, it threw this error:

AttributeError: 'WebDriver' object has no attribute 'get_device_time'

Environment

  • Appium version (or git revision) that exhibits the issue: 1.16.0
  • Last Appium version that did not exhibit the issue (if applicable): N/A
  • Desktop OS/version used to run Appium: Windows 10
  • Node.js version (unless using Appium.app|exe): v8.11.3
  • Npm or Yarn package manager: npm
  • Mobile platform/version under test: android 9
  • Real device or emulator/simulator: real device
  • Appium CLI or Appium.app|exe: Appium CLI

Details

  1. I start appium service by using this command(before that I updated appium to 1.16.0 by using npm -g update appium):

     appium -p 4723
    
  2. I set up the driver on my python script:

    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    
  3. I am trying to get device time by using:

     driver.get_device_time("YYYY-MM-DD HH")
    
  4. I ran the python script and it threw the following error:

    AttributeError: 'WebDriver' object has no attribute 'get_device_time'
    

However, if I use the appium desktop app(1.16.0) instead of starting appium on cmd line, it worked fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
zhengyu88commented, Jan 19, 2020

I upgraded Appium-Python-Client to 0.49, and it was working, thank you so much!

0reactions
ki4070macommented, Jan 19, 2020

@zhengyu88 Thanks for your info.

v0.28 doesn’t have get_device_time(), it’s available from v0.35. Please update Appium-Python-Client and try again.

[Notes] Added format to device_time as argument https://github.com/appium/python-client/pull/312

Not sure why it works with below environments from current info.

However, if I use the appium desktop app(1.16.0) instead of starting appium on cmd line, it worked fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium - AttributeError: 'WebDriver' object has no attribute ...
I wrote a code in Python for Web Scraping and fetching HTML table but its throwing an Attribute Error : 'WebDriver' object has...
Read more >
attributeerror: 'webdriver' object has no attribute 'driver'
Why getting error AttributeError: 'WebDriver' object has no attribute 'executes_script' ... I am trying to get device time by using:
Read more >
Unable to locate an element with latest appium python client ...
After upgrading the version to the latest ones observing this issue when I trigger any script: AttributeError: 'WebDriver' object has no attribute ......
Read more >
'WebDriver' object has no attribute 'find_elements_by_xpath'
i got an error while trying to run a robot framework script. Can some one help me to solve the issue. Basically xpath...
Read more >
Selenium — Python — AttributeError: 'WebDriver' object has ...
Solved — Selenium — Python — AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'. Get Selenium working with Chrome — Deprecated ...
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