How to do the image based testing

Ask general questions here.
premravi
Posts: 63
Joined: Tue Jan 08, 2019 1:55 pm

How to do the image based testing

Post by premravi » Fri Jan 11, 2019 3:55 pm

Hi,

I have so many elements on the web page which are difficult to identify using ranorex spy so we are going with co-ordinates and then trying to perform operation on it

Please let me know how can I capture an element on the application by turning on the image based automation feature and then how to perform operations on it

Please let me know if any more information is required

Thanks

qwertzu
Posts: 243
Joined: Wed Jan 25, 2017 11:08 am

Re: How to do the image based testing

Post by qwertzu » Mon Jan 14, 2019 8:58 am

Hi,

The easiest way to implement image based actions is using the Ranorex recorder and activating the "Image Based recording" option.
Details about image based automation can be found here:

regards, qwertzu

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4802
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to do the image based testing

Post by odklizec » Mon Jan 14, 2019 9:05 am

Hi,

In my opinion, image-based automation, in global scale, is just a waste of time. It will never be so reliable as xpath-based automation. It's handy in case of certain problematic elements, but only if used scarcely. It's nothing to be used on regular basis.

Could you please upload a ranorex snapshot (NOT screenshot) of your web page, so we can examine it and suggest better approach than image-based automation?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

premravi
Posts: 63
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to do the image based testing

Post by premravi » Tue Jan 29, 2019 11:14 am

Hi,
Thanks for your response, but I am also helpless as image is the only option what I can think of
Because there are hardly any unique identifiers to locate the element and perform any action on it
I am attaching the zip folder (rxsln) just in case if it helps you to analyse and come up with better approach
Awaiting response
Thanks
Attachments
Ranorex_SnapShots.zip
(61.01 KiB) Downloaded 5 times

premravi
Posts: 63
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to do the image based testing

Post by premravi » Tue Jan 29, 2019 11:14 am

Hi,
Thanks for your response, but I am also helpless as image is the only option what I can think of
Because there are hardly any unique identifiers to locate the element and perform any action on it
I am attaching the zip folder (rxsln) just in case if it helps you to analyse and come up with better approach
Awaiting response
Thanks
Attachments
Ranorex_SnapShots.zip
(61.01 KiB) Downloaded 2 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4802
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to do the image based testing

Post by odklizec » Tue Jan 29, 2019 11:45 am

Hi,

Well, looking at the snapshot, your application is really hopeless for TA purposes. There are not only missing IDs, but many elements (list items or buttons) are not identified as individual elements. I don't think that the image-based automation would solve anything. It may work with some simple scenarios, but it would be useless for anything more complicated. Do you have an idea what kind of UI technology is your app built with? I guess it uses something long-time obsolete?

Basically, you have two options. You should try GDI capture approach (described here). And last option is to contact application developers with request to implement proper accessibility. Without accessibility support, there is really not much you can (reliably) do with this application.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

premravi
Posts: 63
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to do the image based testing

Post by premravi » Tue Jan 29, 2019 1:13 pm

Hi,

Thanks a lot for such a genuine feedback

But please help me to automate this application as much as possible

Now as you know the application architecture,

To identify most the elements I am going to perform image based automation

Please help me with an Ad-Hoc scenario of how to implement Image based testing here, so that the same logic I can apply for most the elements

Let's automate for as much elements as we can..............

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4802
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to do the image based testing

Post by odklizec » Tue Jan 29, 2019 1:33 pm

Hi,

Honestly, I don't have a clue what else to suggest? Image-based automation is just a nice-to-have supplement of Ranorex feature set. But it's definitely nothing that should be used regularly or as a main TA solution. I can't imagine a reliable long-term solution, based of the image-based automation.

All I can suggest now is to check this Ranorex User Guide chapter:
https://www.ranorex.com/help/latest/ran ... roduction/
Eventually, this image-based validation example:
https://www.ranorex.com/help/latest/ran ... n-example/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

premravi
Posts: 63
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to do the image based testing

Post by premravi » Tue Jan 29, 2019 2:00 pm

Hi,

That's correct, image based is just a temporary solution,

As you said to update this issue to the developers, we already raised this concern to the developers as well as to our management and the development team is working on it

Till then we are just focusing on the work around

I have gone through the links what you shared but I am looking for a global function/reusable function for image based testing just to click

So whenever any requirement comes in I will call that same method and perform click on it

This is something I found on User Guide, please suggest whether this is the right approach ?

// Create bitmap to search for
// within application form and
// click it
Bitmap bmp = Ranorex.Imaging.Load(
@"....Green Sea Turtle Small.bmp");
// Performs a right click on the image found
// within the application window based on
// the image location
myRepo.WinFormsApp.Self.Click(MouseButtons.Right,bmp);
// You can also search for images that are slightly different to the
// loaded image by specifying the minimum Similarity for a match (95% = 0.95).
myRepo.WinFormsApp.Self.Click(new Location(bmp, new Imaging.FindOptions(0.95)));
// OR Set the default Similarity value for all following image operations
Imaging.FindOptions.Default.Similarity = 0.95;
myRepo.WinFormsApp.Self.Click(bmp);
Report.Success("Image found and clicked successfully");