简体   繁体   中英

How to click device back button using Selenium, android and C#

在此处输入图片说明 I am presently running an automation script, I want to click on the device back button, though I have used this snippet driver.Navigation().back() previously that worked for clicking app back button. how do click that of the device?

please try below code

 driver.pressKeyCode(AndroidKeyCode.BACK); // it will android device back button 

if you want to perform any other operation with android device keys you can use same approach.You will get keys in AndroidKeyCode .

hope these helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM