1

I am doing automation on Firefox OS (Gaia) on a feature phone using marionette in Python.

Problem

I am not able to simulate hardware keyevents for the navigation keys and other selection keys on some applications (see in code "ApplicationName"). However I am able to use them on native apps.

Code

Below is my code snippet:

#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

What could be the cause?

hc_dev
  • 8,389
  • 1
  • 26
  • 38

0 Answers0