Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screenshot does not properly capture the screen #350

Closed
1ak31sha opened this issue Jun 14, 2016 · 11 comments
Closed

screenshot does not properly capture the screen #350

1ak31sha opened this issue Jun 14, 2016 · 11 comments

Comments

@1ak31sha
Copy link

I am using spoon to take some screen shots on our new 'bottombar' in an android app during a UI test, and realized that it is not capturing our left most button, even though i see that it was on the screen during the espresso test.

This left button is being drawn, whereas the buttons that show up correctly are done with svgs. Any idea why Spoon would not capture whats actually visible?

Thanks so much!

@1ak31sha
Copy link
Author

Is anyone able to help me investigate this? What needs to be done in order for the screenshot to be captured properly? Could anyone provide any resources?

@kwiky
Copy link

kwiky commented Jul 5, 2016

I use FalconSpoon class from Falcon : https://github.com/jraska/Falcon#spoon-compat

@1ak31sha
Copy link
Author

I was able to get my screenshot to work by using screengrab(which i beleive is forked from spoon) and modifying the code a bit. it would be nice to see this go into spoon

@1ak31sha
Copy link
Author

Falcon worked great as well!

@gen0083
Copy link

gen0083 commented Sep 26, 2016

I met the same issue.
Project is here: https://github.com/gen0083/ViewDrawingTest

This project is a testing custom view draw as expected.
The view extends TextView and draw line around own.
Lines right side and bottom are drawn on real device expectedly.
But screenshot took by Spoon was not drawn.

@tir38
Copy link
Contributor

tir38 commented Sep 27, 2016

Screenshots are always helpful. What is Spoon capturing? What is Spoon supposed to be capturing?

Spoon doesn't do anything fancy to take screenshots. So drop some breakpoints in the source and see what dimensions your View is and compare it with what you think it should be. Specifically, put a breakpoint here: https://github.com/square/spoon/blob/master/spoon-client/src/main/java/com/squareup/spoon/Spoon.java#L94

@1ak31sha
Copy link
Author

check this out - notice the graphical issue on the 'progress bar' and the bottom menu bar is missing its button on the bottom left. never looks like this when running the app
1475090461281_aftersignup2

@tir38
Copy link
Contributor

tir38 commented Sep 29, 2016

dumb question: is it only this screen that problems exist? or is Spoon always chopping that portion of the window?

@1ak31sha
Copy link
Author

yea, it vary by the screen. the other screens in this app are webviews and
dont have this problem. this developer told me these things were custom
drawn, which is maybe why spoon has trouble with it.

On Thu, Sep 29, 2016 at 3:52 PM, Jason Atwood [email protected]
wrote:

dumb question: is it only this screen that problems exist? or is Spoon
always chopping that portion of the window?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#350 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AO5XR1vFvPJWVBtHFfcG8fuf3EJRG771ks5qvBb5gaJpZM4I1tb2
.

@tir38
Copy link
Contributor

tir38 commented Oct 4, 2016

What do you mean by custom drawn? Do you mean a custom view (i.e. your own subclass of View)? If so then that shouldn't be a problem.

If you mean that it is rendered in a custom way then that could definitely be the source of your trouble. Find out if that view is creating its own Window.

What happens if you add a "placeholder" view to your view hierarchy that "sit's behind" the missing part? Does Spoon correctly capture that?

@JakeWharton
Copy link
Collaborator

Dupe of #4.

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

No branches or pull requests

5 participants