將我的appium版本升級到1.6.3後出現此問題。無論何時我使用driver.launchApp();
命令,它都會清除應用數據,因此我無法執行下一個特殊情況。如何阻止appium清除Android應用程序數據?
我嘗試設置下面的Desired功能,但每次嘗試啓動應用程序時仍然會清除應用程序數據。
capabilities.setCapability("noReset", "true");
所以情況是,我登錄到應用程序然後重新啓動應用程序,並appium清除應用數據,並再次登錄屏幕出現不應該出現。
下面是我們可以清楚看到appium正在清除應用程序數據的日誌。
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","am","force-stop","PACKAGENAME"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","pm","clear","PACKAGENAME"]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","am","start","-W","-n","PACKAGENAME/.ui.SplashActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
它會在應用程序數據再次啓動時清除它。但是你的應用程序代碼處理這些?如果在應用程序寫入代碼被寫入,您應該移動到下一個屏幕。 –
@jiteshmohite你沒有得到我的問題。通過添加appium 1.6,他們添加了(以前的版本沒有清除應用程序數據的代碼)代碼來清除所有本地應用程序數據(包括所有數據庫文件和緩存)。如果所有數據都被清除,移動到下一個屏幕沒有任何意義。 – Vinod