B2G/QA/Automation/Style Guide/Howtos: Difference between revisions

Line 77: Line 77:
</source>
</source>


== Switching frames and system frame ==
== Switching frames and System Frame ==
A frame is basically the context where marionette operates on.  If marionette is on a frame that does not contain currently displayed UI elements, marionette will not find those UI elements, even if the user can see them on the phone at the time of the test.
A frame is basically the context where marionette operates on.  If marionette is on a frame that does not contain currently displayed UI elements, marionette will not find those UI elements, even if the user can see them on the phone at the time of the test.
<br><br>
<br><br>
System frame is a level above from app frame, where the window handle for each app or system dialog are accessible.  When you're on system frame, you won't be able to access UI elements that belongs to apps.
<br><br>
[http://marionette-client.readthedocs.org/en/latest/reference.html?highlight=switch_to_frame#marionette_driver.marionette.Marionette.switch_to_frame switch_to_frame()] command lets you change the frame, and you may need to do this when you need to manipulate system dialog or browser window instance.
[http://marionette-client.readthedocs.org/en/latest/reference.html?highlight=switch_to_frame#marionette_driver.marionette.Marionette.switch_to_frame switch_to_frame()] command lets you change the frame, and you may need to do this when you need to manipulate system dialog or browser window instance.
<source python>
<source python>
352

edits