Problem:
1. Connection to the server is unsuccessful (file:///www/asset/index.html) (Reason: Android system issue, need to update)
2, Appium test mixed app, did not return WebView (reason: mainly due to Android version problem, need native system android4.4)
3. The Android SDK cannot update the package
4. Extra file update failure in Android SDK
Solution:
First, update the SDK, the steps are as follows:
1. Modify the Hosts file
Open C:/windows/system32/divers/etc/hosts and write the content
74.125.237.1 dl-ssl.google.com
203.208.46.146 www.google.com
74.125.113.121 developer.android.com
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
2. Configure Android SDK Manager
Open Android SDK manager>tools>options:
HTTP Proxy Server:mirrors.neusoft.edu.cn
HTTP Proxy port:80
and select Force https://... sources to be fetched using/http ...
Click Close, then click Package Reload to wait for the update
Second, install android4.4.2 native system
1. Tick all android4.4.2 files in the Android SDK update list to install
2. Check all tools Options, android4.4.2 all options, extra all options
3. If the extra update fails, manually download the file Haxm-windows_v6_0_3.zip (6.0.3) directly
: Https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Simply follow the prompts to install
Third, open the Android AVD new simulator
1, Device:nexus One (3.7 ", 480*800:hdpi)
Target:android 4.4.2-api Level 19
Cpu:goole APIs Intel Atom (x86)
Skin:no Skin
Internal storage:200
SD Card:1gib (if 0, install app may fail)
Iv. in the Eclipse Environment, edit the script
private void Switchtocontext (String swindow) {
set<string> contextnames = Driver.getcontexthandles ();
for (String contextname:contextnames) {
if (Contextname.contains (Swindow)) {
Driver.context (Contextname);
Break
}
}
}
@Test
public void Test0 () {
Switchtocontext ("The name of your WebView");
Driver.findelementbyid ("WD"). SendKeys ("test");
Driver.findelementbyid ("Sub"). Click ();
Switchtocontext ("Native_app");
Driver.findelementbyid ("Com.blossom.android:id/back"). Click ();
}
Fix Android SDK cannot be updated, Appium test hybrid app cannot return WebView issue