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