Git Product home page Git Product logo

Comments (3)

renas avatar renas commented on August 19, 2024

From [email protected] on October 15, 2010 19:34:32

The problem with adding this functionality is that a security tag is needed in the application under test that allows of saving the screenshot. So basically anyone who wants to use Robotium must add that security permission tag to the AndroidManifest.xml of the application under test. That is not something that we can require all Robotium users to do. Thus we have not included this feature into Robotium.

Status: WontFix

from robotium.

renas avatar renas commented on August 19, 2024

From [email protected] on October 15, 2010 20:08:23

I actually control the build of my app and I am thinking writing small piece of code to do this.
Could you please point me to some code to do this.

Thanks a lot for quick updates.

from robotium.

renas avatar renas commented on August 19, 2024

From [email protected] on January 06, 2012 03:18:07

Hi there i know the answer what i am posting was too late but it would help someone out there, i got the help form the link http://softteco.blogspot.com/2011/04/android-take-screenshot.html If you can't get to the link

just try the below code

// set your location
private static final String SCREEN_SHOTS_LOCATION = "/media/screenshots";

public static void takeScreenShot(View view, String name) throws Exception {
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap b = view.getDrawingCache();
FileOutputStream fos = null;
try {
File sddir = new File(SCREEN_SHOTS_LOCATION);
if (!sddir.exists()) {
sddir.mkdirs();
}
fos = new FileOutputStream(SCREEN_SHOTS_LOCATION + name + "_"

  • System.currentTimeMillis() + ".jpg");
    if (fos != null) {
    b.compress(Bitmap.CompressFormat.JPEG, 90, fos);
    fos.close();
    }
    } catch (Exception e) {
    }
    }

Call:

Utils.takeScreenShot(solo.getViews().get(0), getName());

cheers
RanjithkumarRagavan
Enterprise Mobile Developer
ProkarmaSoftech pvt.lt
Chennai

from robotium.

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.