How fast does Report.screenshot() capture a graphic?

Ask general questions here.
atruon
Posts: 12
Joined: Wed May 24, 2017 11:14 pm

How fast does Report.screenshot() capture a graphic?

Post by atruon » Tue Nov 07, 2017 8:44 pm

Hello,
I try to test a blinking object by getting the start and end time when it is blinking ( like 2 or 3s), the period of how often the object blinks. Since I know the period of time how often the object blinks, I can have a for loop like this:
boolean isVisible = false;
boolean isInvisible = false;
for(int i = 0; i < totalTime; i += rate){
Report.screenshot();
// Compare an image that has visible object with the screenshot here
if(exist)
isVisible = true;
else
isInVisible = true;
}
if(isVisible == true && isInvisible == true)
//print out the successful message that the object is actually blinking.
else
//print out the unsuccessful message that the object is not blinking.

Note: totalTime is the time when the object blinks and does not blink
rate is the time how fast the object blinks
This is just a rough draft of how i am going to test the blinking object. Therefore, I would like to know how fast screenshot() capture a screenshot. Also, let me know if my plan to test the blinking object is ok.
Thanks,
Anh.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How fast does Report.screenshot() capture a graphic?

Post by krstcs » Tue Nov 07, 2017 9:32 pm

Can you explain what you are trying to do?

Testing the rate of a blink is not something that is usually done with a functional UI automation tool like Ranorex, and honestly it doesn't seem to me to be important in the actual testing of a piece of software. As long as you can manually verify that there is a blink at the correct rate, it seems to me that that would be a better use of your time than trying to create an automated solution that may never be accurate.
Shortcuts usually aren't...

atruon
Posts: 12
Joined: Wed May 24, 2017 11:14 pm

Re: How fast does Report.screenshot() capture a graphic?

Post by atruon » Tue Nov 07, 2017 10:29 pm

No, I want to test an object that blinks on runtime if I configure the object with blinking.

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: How fast does Report.screenshot() capture a graphic?

Post by jma » Wed Nov 08, 2017 1:58 pm

I would also recommend against automating such a use case because there's probably no robust solution. Concerning the Report.Screenshot- or Validate.ContainsImage-method - I would suggest giving it a try. How long it will take to capture the screenshot could vary slightly. Note that if you pass a specific repository item to those methods, Ranorex also needs time to search those UI elements before the screenshot or image based validation is performed. Since the time to find UI elements depends on the RanoreXPath and also on the processing power of your machine, there's no definite answer to your question. I guess the only way is to give it a try!

atruon
Posts: 12
Joined: Wed May 24, 2017 11:14 pm

Re: How fast does Report.screenshot() capture a graphic?

Post by atruon » Thu Nov 09, 2017 10:31 pm

Thank you, I will give it a try.