Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

the picture is not right when using Spoon.screenshot #63

Open
wangfuwen000 opened this issue Nov 5, 2014 · 2 comments
Open

the picture is not right when using Spoon.screenshot #63

wangfuwen000 opened this issue Nov 5, 2014 · 2 comments

Comments

@wangfuwen000
Copy link

in instrument test project ,take picture using calss spoon-cient.jar to take a screenshot, but the picture is aways is start app picture, not the picture in the process running in app.just like below:

device-2014-11-05-212035

my code:
hotellistpage.addFavourate(hotle);
solo.clickOnText("我的收藏");

    getInstrumentation().waitForIdleSync();
    Spoon.screenshot(getActivity(), "isSavaInFavourate");

    personlcenter.isSavaInFavourate(hotle);
    personlcenter.back();

envirorment:
spoon-client-1.1.1.jar
robotium-solo-4.0.jar

please let me know why ASAP?

thanks very much!

@wangfuwen000
Copy link
Author

my script is like below:

@wangfuwen000
Copy link
Author

package com.elong.android.gui.dhotel;

import org.junit.BeforeClass;

import com.dp.android.elong.utils.Base;
import com.elong.android.gui.pages.HomePage;
import com.elong.android.gui.pages.HotelListPage;
import com.elong.android.gui.pages.HotelSearchPage;
import com.elong.android.gui.pages.PersonalCenter;
import com.elong.android.gui.test.R;
import com.squareup.spoon.Spoon;

;

public class HotelFavourateTest4 extends Base {

private String usrname;
private String password;
private String hotle;

@BeforeClass
protected void setUp() throws Exception {

    super.setUp();
    usrname =  getInstrumentation().getContext().getString(R.string.usrname);
    password = getInstrumentation().getContext().getString(R.string.password);
    hotle = getInstrumentation().getContext().getString(R.string.hotle);
}


public void testHotelFavourate(){

    solo.sleep(5000);

    HomePage homepage = new HomePage(solo);
    homepage.isOnShow();
    homepage.navigateTo("个人中心");
    homepage.login(usrname,password);
    solo.sleep(5000);


    PersonalCenter personlcenter = new PersonalCenter(solo);
    personlcenter.isOnShow();

    homepage.navigateTo("首页");
    homepage.isOnShow();

    homepage.navigateTo("附近酒店");


    HotelListPage hotellistpage = new HotelListPage(solo);
    hotellistpage.isOnShow();

    solo.clickOnText("我的收藏");
    personlcenter.deleteFavourate();
    personlcenter.back();


    hotellistpage.addFavourate(hotle);

    solo.clickOnText("我的收藏");

    getInstrumentation().waitForIdleSync();
    Spoon.screenshot(getActivity(), "isSavaInFavourate");

    personlcenter.isSavaInFavourate(hotle);
    personlcenter.back();

    b = true;
}

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant