Screenshot of specific image in the screen

Hi, I want to ask whether it is possible to take a screenshot of a specific image or logo in the screen. I know that verifyImagePresent takes the image on the screen and compare it with the other image, but is there any way to take the screenshot?

Katalon Studio does not provide built-in keyword which takes screenshot of a HTML element in a web page. You need to have custom code to do that.

Have a look at this post:

2 Likes

Thank you for the answer. Really appreciate it!

The following post may be interesting for you

Hi kazur,
I tried the TC0 in your project, it seems that Katalon’s verifyImagePresent is not working? I get a return error that the data files is NOT present.
Is this a common issue?
Thanks,
Hansen William

Screen Shot 2018-11-02 at 11.41.47.png

Hanzen,

TC0 were passing during 28-31 Oct 2018, but today 3 Nov 2018 it fails. Yes, TC0 will fail because our Application Under Test ( https://www.google.com/ ) has changed.

Until 31 Oct (days before Halloween), on https://www.google.com we could see this picture
https://github.com/kazurayam/ComparingScreenshotsOfWebElement/blob/master/Data%20Files/images/halloween2.png

Today we see the usual Google logo on https://www.google.com/ because Halloween has passed. When you run TC0 today, it tries to find the halloween2.png picture in the Google Search page but in vain.

I am not going to change the demo project. A bit confusing, I must admit. :wink:

You can edit the source of TC0 and try to see what happens.

1 Like

@Hansen_William @kazurayam

If the logo is a valid web element on the page (which it usually is), you can take advantage of the built-in web element image capturing mechanism in the Web Recorder. It’s part of the workflow for image-based testing where you need to take a screenshot of the element first and later on use it in the test.

Hi,

Does this solution work for mobile testing as well?

Regards,
Vergil