Wait mode in Appium use

Source: Internet
Author: User

Background:

First of all, because of a speed and phone performance and server response time and so on, it is not possible to cause us to click on a certain element, the page it is linked to immediately pop out to do the next step. So we need a way to wait until the linked page jumps out and then the next step.

Workaround:
There are 3 ways to do this in Appium, and then I'll show you how to use the Simple 2 wait:

First (forced wait):

How to use : Time.sleep (10)
explanation : The way to force the wait, regardless of whether your next page is displayed, the system will force wait 10 seconds, 10 seconds after the next step. If the next page of the 10s is displayed, the following steps will continue, and if the following page is not shown then the system will report an error (the element on the next page to perform the action is not found).
Specific Use :

The wait time is determined at the discretion of the two operations that are added to the forced wait statement.

The second type (implicit wait):

How to use : self.dr.implicitly_wait (5)

Explanation: The global Wait method, if the control is not found, will be repeated within 5 seconds to find, after finding whether or not to 5 seconds, continue to the next step. If it is not found after 5 seconds, the system will report an error (the element on the next page to perform the action is not found).

Specific Use :

The wait time is determined at the discretion of the two operations that are added to the forced wait statement.

Error-prone point: If the current page exists with the same element as the next page to execute, it is very likely that the current page will be executed, resulting in subsequent errors.

I would rather suggest the first kind of use, simple and rude.

Wait mode in Appium use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.