I've launch my emulator and installed the app that I am testing via Appium. The emulator is Android 6.0 API Level 23. Working to windows I am able to authenticate to the application, create folders, however when I am trying to upload a document to a folder I am getting the following error:
08-08 08:30:33.100: W/System.err(2220): java.io.FileNotFoundException: /storage/emulated/0/Download/alona.txt: open failed: EACCES (Permission denied) 08-08 08:30:33.100: W/System.err(2220): at libcore.io.IoBridge.open(IoBridge.java:452) 08-08 08:30:33.100: W/System.err(2220): at java.io.FileInputStream.(FileInputStream.java:76) 08-08 08:30:33.100: W/System.err(2220): at java.io.FileInputStream.(FileInputStream.java:103) 08-08 08:30:33.100: W/System.err(2220): at com.watchdox.android.upload.UploadTask.getInputStreamForFileToUpload(UploadTask.java:680) 08-08 08:30:33.100: W/System.err(2220): at com.watchdox.android.upload.UploadTask.run(UploadTask.java:206) 08-08 08:30:33.100: W/System.err(2220): Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) 08-08 08:30:33.101: W/System.err(2220): at libcore.io.Posix.open(Native Method) 08-08 08:30:33.101: W/System.err(2220): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) 08-08 08:30:33.101: W/System.err(2220): at libcore.io.IoBridge.open(IoBridge.java:438) 08-08 08:30:33.101: W/System.err(2220): ... 4 more
public void uploadDocument() { wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("com.watchdox.android:id/bpr_progress"))); driver.findElementById("com.watchdox.android:id/action_more").click(); driver.findElementById("com.watchdox.android:id/upload_menu_button_txt").click(); try { driver.findElementById("com.android.packageinstaller:id/permission_allow_button").click(); } catch (NoSuchElementException exception) { System.out.println("No permission_allow_button"); } driver.findElementByClassName("android.widget.ImageButton").click();
driver.findElementByName("Internal storage").click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("Download")));
driver.findElementByName("Download").click();
driver.findElementByName("alona.txt").click();
}
The document is located in an internal storage
/storage/emulated/0/Download/ permission is drwxrwx--x alona.txt document with -rw-rw---- Permissions
I have no idea how to change the permissions of the emulator storage
Aucun commentaire:
Enregistrer un commentaire