Marionette 无法为第三方应用程序上的导航键发送keyevents

Marionette 无法为第三方应用程序上的导航键发送keyevents,marionette,firefox-os,gaia,Marionette,Firefox Os,Gaia,我正在使用Python中的merionette在功能手机上的Firefox OS上实现自动化 我的问题是,我无法在某些应用程序上模拟导航键和其他选择键的硬件键事件(在下面的示例中,名称为ApplicationName)。 不过,我可以在本机应用程序上使用它们 下面是我的代码片段: #creating marionette client on port 2828 client = Marionette('localhost', port=2828) client.start_session() #

我正在使用Python中的merionette在功能手机上的Firefox OS上实现自动化

我的问题是,我无法在某些应用程序上模拟导航键和其他选择键的硬件键事件(在下面的示例中,名称为ApplicationName)。 不过,我可以在本机应用程序上使用它们

下面是我的代码片段:

#creating marionette client on port 2828
client = Marionette('localhost', port=2828)
client.start_session()
#import js script to launch app by name
js = os.path.abspath("/usr/local/script.js")
client.import_script(js)
result=client.execute_async_script("GaiaApps.launchWithName('%s')" % "ApplicationName")
client.switch_to_frame(result.get("frame"))
num = "123456"
client.find_element('css selector','input[type=text]').send_keys(num)
#Above code is working fine

#below code is not working on some thirdparty applications
client.execute_script("window.dispatchEvent(new KeyboardEvent('keydown', {key: 'ArrowDown', keyCode: 40}))")

#closing the client
client.close

原因可能是什么?

找到解决方案了吗?找到解决方案了吗?