Hey All,
First, let me give a general idea of what i'm doing. At this moment i'm automating a google map-like map. I can draw a polygon on it and save it. After it is saved, it will show an image of the map with the polygon on it.
Now I want to take a screenshot of that image and use it in a later recording to compare it.
How can one do that?
Thanks,
Bart
Take a screenshot and use it to compare
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Take a screenshot and use it to compare
Hi dkmpbrt,
Please check out the following links/discussions:
Cheers,
Robin
Please check out the following links/discussions:
- • https://www.ranorex.com/blog/enhanced-f ... alidation/
• https://www.ranorex.com/forum/image-val ... 10972.html
Cheers,
Robin
Re: Take a screenshot and use it to compare
Hey Robin,
Thanks for your answer, this already helps, but i'm just not sure on how to save an image of a repository item at run time. Probably this will be in C# but I don't think the Ranorex.Screenshot() will be of any use because it is purely used as reporting, no?
Thx,
Bart
Thanks for your answer, this already helps, but i'm just not sure on how to save an image of a repository item at run time. Probably this will be in C# but I don't think the Ranorex.Screenshot() will be of any use because it is purely used as reporting, no?
Thx,
Bart
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Take a screenshot and use it to compare
Hey Bart,
You could use the following code to create a screenshot during runtime.
Sample: Creates s screenshot of a button element and logs it to the Ranorex report
Robin
You could use the following code to create a screenshot during runtime.
Sample: Creates s screenshot of a button element and logs it to the Ranorex report
public void Report_Screenshot_Button1(RepoItemInfo buttonInfo) { var bla = Ranorex.Imaging.CaptureImageAuto(buttonInfo.FindAdapter<Button>()); Report.LogData(ReportLevel.Info, "User", bla); }Cheers,
Robin