|
|
| Line 113: |
Line 113: |
| messages.send() | | messages.send() |
| </source> | | </source> |
|
| |
| == Avoid sleep() calls <njpark> ==
| |
| Sleep methods can be used as follows:
| |
| <source python>
| |
| import time
| |
| time.sleep(seconds)
| |
| </source>
| |
| However, sleep() calls should be used very sparingly, only when there is no other way to delay the action of Marionette. Using sleep() when Wait() can accomplish the same thing would be bad for following reasons:
| |
| * Sleep() does not care about the UI changes in app. If you're using sleep() to just 'wait enough', you'll run into problems when the app behavior changes and requires more/less time to wait.
| |
| * Sleep() does not care about the phone performance. If the speed of the execution changes because of the changes in memory allocation or running on a newer/older devices, it will still wait for specified time.
| |
| When you have to use the sleep() call, make sure to put in the comment explaining why other methods won't work.
| |
|
| |
|
| == Variable naming <jlorenzo> == | | == Variable naming <jlorenzo> == |