Appium switch Native/webview,findby, and page element positioning has been less than 0 of the problem of resolution

Source: Internet
Author: User
Tags appium

A bug has not been resolved before.

Today, it's finally settled.

Question process:

App is a hybrid application, after the project has been H5 optimized, the previous use case execution always fails, reflected in the original one element click No feedback

Troubleshooting reasons: 1. The project was H5 optimized, 2. The code of the test was also optimized

2. After the project code changes, the original findby to find the element, the positioning of the element is always less than 0, will not change

3.findby is the element control information that is filled in at initialization time, and subsequent if no refresh may not change the positioning at all.

Workaround: After changing the positioning of the element, getpagesource the control information again.

while (Loginbutton.getlocation (). x<0) {System.out.println (Loginbutton.getlocation (). x);d River.getpagesource () ; Thread.Sleep (3000);}

Tips: If it's a native control, it can be crawled in Chrome's inspect, but it's still not working.

Appium switch Native/webview,findby, and page element positioning has been less than 0 of the problem of resolution

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.