dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.62k stars 347 forks source link

Getting lots of "AdbClient instance has no attribute 'getRestrictedScreen'" #116

Closed JasonMMorgan closed 9 years ago

JasonMMorgan commented 9 years ago

I've recently started seeing this error repeatedly in a test program:

(x, y, width, height) = device.getRestrictedScreen() AttributeError: AdbClient instance has not attribute 'getRestrictedScreen'

When I run the dumpsys command manually on the device I normally see this:

adb shell > dumpsys window | grep "mRestrictedScreen" dumpsys window | grep "mRestrictedScreen" mRestrictedScreen=(0,0) 720x1280

Occasionally (<10%) it doesn't find a match, but I don't understand how that would account for the almost 100% failure rate I'm seeing in the test program now. It was working reliably before.

Other details:

Do you have any ideas for further investigation?

Thanks for sharing all your work on this AVC!

dtmilano commented 9 years ago

Is your test invoking

(x, y, width, height) = device.getRestrictedScreen()

?

In that case you should use the newer display properties device.display['width'] and device.display['height'].

On Fri, Nov 28, 2014 at 6:00 PM, JasonMMorgan notifications@github.com wrote:

I've recently started seeing this error repeatedly in a test program:

(x, y, width, height) = device.getRestrictedScreen() AttributeError: AdbClient instance has not attribute 'getRestrictedScreen'

When I run the dumpsys command manually on the device I normally see this:

adb shell > dumpsys window | grep "mRestrictedScreen" dumpsys window | grep "mRestrictedScreen" mRestrictedScreen=(0,0) 720x1280

Occasionally (<10%) it doesn't find a match, but I don't understand how that would account for the almost 100% failure rate I'm seeing in the test program now. It was working reliably before.

Other details:

  • AVC version: androidviewclient (8.17.3)
  • Samsung and HTC devices running Android 4.4.4

Do you have any ideas for further investigation?

Thanks for sharing all your work on this AVC!

— Reply to this email directly or view it on GitHub https://github.com/dtmilano/AndroidViewClient/issues/116.

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

awkasem commented 9 years ago

This works for me:

(x, y, width, height) = device._AdbClient__getRestrictedScreen()

JasonMMorgan commented 9 years ago

Thanks. Using device.display['width'] solved my issue. I was able to see 'device.display' by looking at the variables while running in debug mode once I knew what to look for.

I couldn't find anything in the documentation about it though. How could/should I have found this on my own?

dtmilano commented 9 years ago

Yes, documentation is lagging behind. The source is the best documentation as of now. Additions to the wiki are always welcome.

On Tue, Dec 2, 2014 at 12:58 PM, JasonMMorgan notifications@github.com wrote:

Thanks. Using device.display['width'] solved my issue. I was able to see 'device.display' by looking at the variables while running in debug mode once I knew what to look for.

I couldn't find anything in the documentation about it though. How could/should I have found this on my own?

— Reply to this email directly or view it on GitHub https://github.com/dtmilano/AndroidViewClient/issues/116#issuecomment-65274169 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients