Get Height and Length of screen for Android driver NATIVE

I’m looking a way to find the size of the screen when I’m in a NATIVE context on Android.
I know that for browser in WEBVIEW I can use @browser.execute_script(“return window.innerWidth”) as exemple to have browser size but it’s doesn’t work in a app.
Do someone knows a way to get this ?
Thanks !

example java driver.manage().window().getSize().getHeight()

driver.manage().window().getSize() doesnot work in appium

did you ever find a solution to this?

you are right the ‘driver.manage().window().getSize().getHeight()’ is not supported in Android webviews

EDIT: if you just switch the context to native and perform it it works. then just switch back to webview. would this work for you?


I managed to to do tgis using some sort of JavaScript.
Exact code i can share on monday as now i can’t remember.
I also posted similar answer in stackoverflow. Try a search there also

Go here

See answer from san1deep2set3hi

Let me know if it works for u

Awesome! I’ll check stackoverflow. No worries. Thanks.