imzzy / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

TakeScreenshot with solo makes the keyboard and status bar disappear #652

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. write testcode that shows the keyboard (solo.clickOnEditText(0)) , and write
solo.takeScreenShot("stamStringName",100);
2.
3.

What is the expected output? 
A screenshot that contains what is currently visible on the screen
including the status bar and the kyboard

What do you see instead?
part of my app, with blank row where the status bar is supposed to be
blank square where the keyboard is supposed to be

What version of the product are you using?
Robotium Solo 5.2.1

On what operating system?
Android 4.4

Please provide any additional information below.

here is my test
 public void testTakeScreenShot(){
        solo.assertCurrentActivity("wrong activity", ContactPickerActivity.class);
        solo.sleep(15000);

        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                ContactAdapter adapter = ((ContactPickerActivity) getActivity()).contactsAdapter;
                ArrayList<ContactData> items = new ArrayList<ContactData>();
                items.add(new ContactData("0","יוסי","חדד ","יוסי חדד ","0501234567","",false));
                items.add(new ContactData("1","משה","מילר  ","משה מילר  ","0501234567","",true));
                items.add(new ContactData("2","יוסי","לדרמן ","יוסי לדרמן ","0541234567","",false));
                items.add(new ContactData("3","יששכר","פלדמן ","יששכר פלדמן ","0507654321","",false));
                items.add(new ContactData("4","דימה","חדד ","דימה חדד ","0501234567","",true));
                items.add(new ContactData("5","משה","חדד ","משה חדד ","0507654321","",false));
                items.add(new ContactData("6","אלי","שמש  ","אלי שמש  ","0549876543","",true));
                items.add(new ContactData("7","דוד","חדד ","דוד חדד ","0549876543","",false));
                items.add(new ContactData("8", "נחום", "ראובנוב ", "נחום ראובנוב ", "0507654321", "", true));
                adapter.clear();
                adapter.addAll(items);
                adapter. notifyDataSetChanged();

            }
        });

        solo.sleep(1000);
        solo.clickOnEditText(0);
        solo.sleep(1000);
        solo.takeScreenshot("Contacts",100);
    }

here is the result : 

https://www.dropbox.com/s/c4mgm8tlvv6yhya/Contacts.jpg?dl=0

expected result:

https://www.dropbox.com/s/qjjhnrp71c9ibju/Screenshot_2015-01-25-13-16-01.png?dl=
0

Original issue reported on code.google.com by lena...@gmail.com on 25 Jan 2015 at 11:25

GoogleCodeExporter commented 9 years ago
Robotium uses Instrumentation and due to this its locked to tha application 
under test. The only process its allowed to take a screenshot of is the app 
process. 

Original comment by renasr...@gmail.com on 27 Jan 2015 at 1:39