Git Product home page Git Product logo

Comments (10)

gailgou avatar gailgou commented on June 12, 2024 2

Hi. I found a decision.

  1. You should add permissions in AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  1. Input in console

adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.READ_EXTERNAL_STORAGE

adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.WRITE_EXTERNAL_STORAGE
3. And now you can take a screenshot

all above i have done .but can't slove the problem

from testing-samples.

dino-su avatar dino-su commented on June 12, 2024 1

Hi @otw,

Can you let me know where to track the permission issue ?

Thanks,
Dino

from testing-samples.

cataglyphis avatar cataglyphis commented on June 12, 2024 1

Hi @otw
We use UiAutomator 2.0 to take screenshot, and found this issue again, dependencies as below:

compileSdkVersion 22
buildToolsVersion "25.0.3"
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:support-annotations:23.1.1'

androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'

Do you have any suggestion to solve this problem, or the higher library has already solved this issue?
Thanks.

from testing-samples.

otw avatar otw commented on June 12, 2024

Thanks for the feedback. Will file a bug on your behalf so we can investigate.

from testing-samples.

AliceSkilsara avatar AliceSkilsara commented on June 12, 2024

I have the same problem
E/UiAutomatorBridge: failed to save screen shot to file
java.io.FileNotFoundException: /sdcard/Pictures/Autotests/1502183344782.png (Permission denied)
with settings
buildToolsVersion = "26.0.0"
supportLibVersion = "25.4.0"
runnerVersion = "1.0.0"
rulesVersion = "1.0.0"
espressoVersion = "3.0.0"
uiautomatorVersion = "2.0.0"

from testing-samples.

JerryLiu0821 avatar JerryLiu0821 commented on June 12, 2024

I have the same problem,
did this issue fixed or not?

Thanks

from testing-samples.

AliceSkilsara avatar AliceSkilsara commented on June 12, 2024

Hi. I found a decision.

  1. You should add permissions in AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  1. Input in console

adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.READ_EXTERNAL_STORAGE

adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.WRITE_EXTERNAL_STORAGE
3. And now you can take a screenshot

from testing-samples.

EmotionalRonan avatar EmotionalRonan commented on June 12, 2024

Hi. I found a decision.

  1. You should add permissions in AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  1. Input in console

adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant com.example.android.testing.uiautomator.your_app android.permission.WRITE_EXTERNAL_STORAGE
3. And now you can take a screenshot

all above i have done .but can't slove the problem

I have the same problem

from testing-samples.

VidyaSumanKumar avatar VidyaSumanKumar commented on June 12, 2024

do we have a fix for this issue

from testing-samples.

brettchabot avatar brettchabot commented on June 12, 2024

I'd recommend saving the file via TestStorage. Check out the Screenshotsample for an example

from testing-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.