Appium can't get the solution to webview content

Source: Internet
Author: User
Tags appium

Prepare to print out the XML content of the article with Page_source when automating tests with Appium on the Little Ape search app

But found that only the external structure of the content can be printed, the actual content of the article is not displayed

As follows

After querying, we know that we need to get all the context through contexts and then switch to the corresponding context via Switch_to.context () to get

By printing the context, the results are as follows

Show only one Native_app, and no other webview information

After another query, we know that only in android4.4 and above version of the system will output more WebView

So when the Android simulator for the night God, the system for android4.4.2, guess the system should be no problem

But with a try attitude, download and install the Carefree Android Simulator (Android version is 4.4.4)

The test results are as follows

Unexpected output of two additional context

Guess it should be different simulators have varying degrees of modification to the Android system

Then through the Switch_to.context () to switch the three context, get the desired body content

Through this experience, we continue to study the related automation test of appium, and also have a deeper understanding of the automated test on mobile.

Appium can't get the solution to webview content

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.