I cannot get any effect using the PressBackKey while testing an Android app. There is no effect for the PressKeyBack action.
Is this a known problem? Has anybody got this working on a real mobile device?
The app is deployed in an Android Emulator (adt-bundle-windows-x86-20130729, AVD_for_Nexus_S_by_Google).
The provided (IronPython) code example is using the Android APIDemos app.
Note that the same logic in C# has the same problem...
Code: Select all
import clr
clr.AddReference('Ranorex.Core')
clr.AddReference('Ranorex.Plugin.Mobile')
import time
from Ranorex.Core import RxPath
from Ranorex import MobileApp, AndroidApp, Text, Host
mobile_device = 'AA'
mobile_app = 'com.example.android.apis'
mobile_app_id = "/mobileapp[@title='com.example.android.apis']"
find_normal_delay = 30000
Host.Local.RunMobileApp(mobile_device, mobile_app)
app = Host.Local.Find[MobileApp](RxPath(mobile_app_id), find_normal_delay)[0]
assert(app.Valid)
choice_id = "./form[@title='ApiDemos']/container/list/text[@caption='App']"
list_choice = app.Find[Text](RxPath(choice_id), find_normal_delay)[0]
assert(list_choice.Valid)
list_choice.Click()
time.sleep(10) # allow for the app to update
AndroidApp(app.Element).PressBackKey()
time.sleep(10) # allow for the app to update
Host.Local.CloseApplication(app.Element)