Hi Craig, execute_async_script expects a callback from marionetteScriptFinished 
and if doesn't get it it will time out.

If you use just execute_script instead of execute_async_script it should work.

Or I think you need to do 
execute_async_script("marionetteScriptFinished(navigator.battery)")

(disclaimer untested as I don't have my phone here right now but I think you 
can work it out!)



----- Original Message -----
From: Craig Comstock <[email protected]>
To: Mozilla B2G mailing list <[email protected]>
Sent: Fri, 07 Feb 2014 18:37:15 -0800 (PST)
Subject: [b2g] marionette script "hanging" on simple javascript...

Maybe I'm not understanding something quite right but I was trying to write 
some python/marionette scripts and the basics detailed here:

https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/Marionette_for_interactive_Python?redirectlocale=en-US&redirectslug=Mozilla%2FFirefox_OS%2FPlatform%2FTesting%2FMarionette_for_interactive_Python

Just don't seem to work... i.e. returning navigator.battery doesn't work, but 
navigator.battery.level does. Making a phone call seems to work but vibrate 
doesn't.

Any ideas why?

I'm running these scripts locally on my keon phone w/ debian installed as well 
to provide python/gcc/etc...

Here's a script that doesn't do anything:

#!/usr/bin/python

from marionette import Marionette
marionette = Marionette('localhost',2828)
marionette.start_session()

result = marionette.execute_async_script("""
        return navigator.vibrate(50);
""")

print(result)



Thanks,
Craig
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to