Hai,
How to do image based validation without ranorex recording module? My application is based on WPF. After placing an image from folder to application, I have to validate the image, whether it is same as in folder or not.
please help..
thanks and regards
Amir aka AutomationTester
How to do image based validation without ranorex recording?
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to do image based validation without ranorex recording?
Hello,
You could use dynamic image validation in User Code as shown in the attached example.
Please take a look at the method 'CheckContainsExternal'.
Please let me know if you need further information.
Regards,
Markus (T)
You could use dynamic image validation in User Code as shown in the attached example.
Please take a look at the method 'CheckContainsExternal'.
Please let me know if you need further information.
Regards,
Markus (T)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to do image based validation without ranorex recording?
Hai Markus,
You are showing me the demo using recording module. I saw the code for image comparison in your file. It's not working when I use it in normal cs file. Can you please write the code in cs file and send me?
Thanks and regards,
Amir aka AutomationTester
You are showing me the demo using recording module. I saw the code for image comparison in your file. It's not working when I use it in normal cs file. Can you please write the code in cs file and send me?
Thanks and regards,
Amir aka AutomationTester
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to do image based validation without ranorex recording?
Hello,
I assume that you are using Visual Studio. Is that correct?
Please find attached a short example how you could use image validation in Visual Studio.
You could use the method 'Ranorex.Imaging.Compare(Bitmap image, Bitmap feature, Double similarity)' in your test. Please take a look at this 'code example' in our User Guide.
Regards,
Markus (T)
I assume that you are using Visual Studio. Is that correct?
Please find attached a short example how you could use image validation in Visual Studio.
You could use the method 'Ranorex.Imaging.Compare(Bitmap image, Bitmap feature, Double similarity)' in your test. Please take a look at this 'code example' in our User Guide.
Regards,
Markus (T)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to do image based validation without ranorex recording?
Hai Markus,
I'm using Ranorex and I want to compare images using code and not by recording. I used your suggested code in my module. In my report, Both images are same but ranorex throws an error of "Module execution was aborted because a validation step has failed. Trying to find image at path: 'C:\Users\****\Desktop\Images\MonalbumPhoto_JPG_Smiley.jpg' ".
The path is correct. I'm attaching screen shot of report and code . Please help with this problem.
If you want anything more. let me know.
Regards,
Amir aka AutomationTester
I'm using Ranorex and I want to compare images using code and not by recording. I used your suggested code in my module. In my report, Both images are same but ranorex throws an error of "Module execution was aborted because a validation step has failed. Trying to find image at path: 'C:\Users\****\Desktop\Images\MonalbumPhoto_JPG_Smiley.jpg' ".
The path is correct. I'm attaching screen shot of report and code . Please help with this problem.
Code: Select all
string picturepath = "C:\\Users\\****\\Desktop\\Images\\MonalbumPhoto_JPG_Smiley.jpg";
Image currentPicture = Image.FromFile(picturepath);
Imaging.FindOptions imgFindOptions = new Imaging.FindOptions(0.1);
Validate.Options valOptions = new Validate.Options();
// runtime validation by using the repository object
Validate.ContainsImage(workarearepo.Tabpagelist.NewlyAddedImage.ImgCanvasInfo, (System.Drawing.Bitmap) currentPicture, imgFindOptions, "Trying to find image at path: '" +picturepath+"'");
Regards,
Amir aka AutomationTester
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to do image based validation without ranorex recording?
Hello,
Could you please try to add a timeout to your options as shown below?
Please take a look at section 'Creating Ranorex Snapshot Files' in our User Guide.
Regards,
Markus (T)
Could you please try to add a timeout to your options as shown below?
int timeOut = 5000; imgFindOptions.Timeout = timeOut;Could you please post a 'Ranorex Snapshot' of your application in order to analyze this issue?
Please take a look at section 'Creating Ranorex Snapshot Files' in our User Guide.
Regards,
Markus (T)
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to do image based validation without ranorex recording?
Dear Markus,
Due to software credentials, I can't send u the Ranorex snapshot. I have attached a snap of png.
Hope this helps.
Thanks and regards,
Amir aka AutomationTester
Due to software credentials, I can't send u the Ranorex snapshot. I have attached a snap of png.
Hope this helps.
Thanks and regards,
Amir aka AutomationTester
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to do image based validation without ranorex recording?
Hello,
Is the resolution of your images the same?
Could you please send us your report to [email protected]?
A Ranorex Snapshot would really help a lot to analyze this issue.
Regards,
Markus (T)
Is the resolution of your images the same?
Could you please send us your report to [email protected]?
A Ranorex Snapshot would really help a lot to analyze this issue.
Regards,
Markus (T)