Forum Discussion
Hi,
> How can we use Visualizer or NameMapping stored images to compare
No way. Those images are provided for your convenience only and cannot be used from within your test code.
You have two options:
a) Use Stores/screenshots comparison as suggested by Robert; or
b) Use some third-party service (like Applitools, for example).
For Visual Testing, We have to compare the images on the go.
In Testcomplete,
1) if we are using visualizer to capture the images
2) No selecting the checkbox for "Auto Update Frames"
3) Capture Images are activated.
Scenario,
If the system 1 with Resolution 1 (Y x Z) in which the Code is created.
In System 2 with Resolution 2 ( A x B) if we are executing the code for eg: Click a button.
The Excution fails due to image capture is not matching.
So, Do we have a possibility to an improved feature to activate the Visual testing
1) Adding Regions, Every Object image need to be added (tedious process)
2) Adding third pary (Appi tools) is expensive.
Instead if we can use
https://support.smartbear.com/testcomplete/docs/reference/program-objects/picture/difference.html
The following method can be used for visual testing.
PictureObj.Difference(Picture, Transparent, PixelTolerance, Mouse, ColorTolerance, Mask)
Instead of Picture loading an external file, If we have a method to refere to Visualization .
Visual testing can be achieved using testcomplete.
Just a thought. Please throw the possibilities and correct me if i'm wrong.
- Vallalarasu_P5 years agoFrequent Contributor
TanyaYatskovska , shankar_r - Can you comment please ?
- Vallalarasu_P5 years agoFrequent Contributor
If we have another function similar to
Current:
w = Sys.Desktop.ActiveWindow().Picture(20, 20, 50, 50);
Regions.AddPicture(w, "MyFile.bmp");New Feature:
w = NameMapping.Sys.QRBrowser.LoginPage.buttonLogIn.Picture()
Regions.AddPicture(w,"LoginButton.Jpg");
- tristaanogre5 years agoEsteemed Contributor
Yes, you can use the Picture.Difference method... that's what I meant by image comparison. However, the initial "PictureObj" in your example STILL needs to be something gathered from the automation in order to do the comparison and, on the fly in the code, you can't grab the images from the Visualizer or from the NameMapping repository. Those images are not available at runtime.
But... that doesn't really seem to be the problem... you mention something about a difference in resolution causing a click to fail. That has nothing to do with image capture... that has to do with how you are coding your clicks and how you are constructing your tests.First of all, you should ALWAYS try to make sure your dev environment and your execution environment match as much as possible.
Secondly, you should avoid, as much as possible, any code execution which requires a hard-coded pixel screen location.
So... it seems that you're conflating problems here... you're trying to solve a "unable to click" problem with something to do with image capture.
It would be helpful if, for those two scenarios, you give us some code example of what you're attempting. Perhaps we can resolve your problem without having to go through image processing.- Vallalarasu_P5 years agoFrequent Contributor
Sorry for getting deviated from my question with the example.
I'm looking for a feature in which the Images are also stored with object properites (NameMapping).
In execution, As we compare Object Properties and Perform methods on it. Similarly, We can verify the Images too.
Yes, We can do that currently by adding all the Images on Regions and Compare on Run time.
Instead, Like Expected Object Properties like IdStr, Object Type are stored in NameMapping.
Expected Image can also be stored during first capture in NameMapping.
A Comparision method for Images can be created based on Every Object without manually adding Images to regions.
In a Simple Way, If Images can be added to regions/NameMapping/ Visualizer using Object properties.
Image Checkpoint or Image Comparision can happen for every step without creating a seperate feature.
Option for Image validation on object level can be create for successful Visual validation.
ExpectedImage = Namemapping.Sys.Myapplication.LoginButton.StoredImage
Method : StoredImage
ActualImage = NameMapping.Sys.Application.LoginButton.RuntimeImage
Method:RunTimeImage
If ExpectedImage = ActualImage , Visual Validation will be sucessful.
Summary.
Storing Images in Regions on Object level
Comparing Images with Object Level
Finding an Alternative for applitools within TestComplete by creating few new methods.
Sorry, If my explaination was not clear.
Thanks for everyone who responded.
- tristaanogre5 years agoEsteemed Contributor
Currently, there is no method by which images can be utilized directly from Visualizer and NameMapping in comparing images on screen. This, I believe, was already mentioned above by AlexKaras . This, I believe, answers your question: You will need to create a repository of baseline images to use in your comparisons so that you can either use the PictureObj.Difference method or a Region Checkpoint to compare images.
If you want such a thing added, there is a feature request area here on the community that you can request it. However, placing a request does not mean it willl get added/created/developed in the short term... meaning, you will STILL need to do the work to create that image respository.
Related Content
- 3 years agoparisgambit
- 11 months agoMW_Didata
- 11 months agoBob_C
Recent Discussions
- 10 hours agojstaehlin
- 2 days agoAivanitskiy