Screenshot comparison with repository Item

Ask general questions here.
priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Screenshot comparison with repository Item

Post by priyank1989 » Wed Jan 22, 2020 8:10 pm

HI,

My windows application support almost 10 Language.

Mostly issues are like if I have button with text "Submit" on it in my English version it looks fine , but If I start application with different language support like Sundanese in that case "Submit" is like "ngalebetkeun" , so there is a chance that text go outside of button width.
Do we have any way to perform automation on this ?

On other side I am thinking to capture screen shot of my each screen manually and want to validate it with Repository Item, will that take care of above scenario like
1. Will capture screenshot of 1 screen with sniptool
2. Will add that entire screen as one Repository item.
3. will use compareImage method and will compare my repo item againts my screenshot

It just a thought, you can suggest me some good way of doing this

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Screenshot comparison with repository Item

Post by priyank1989 » Thu Jan 23, 2020 4:03 pm

anyone have any idea on this ?

User avatar
N612
Posts: 135
Joined: Mon Jul 11, 2016 4:01 pm

Re: Screenshot comparison with repository Item

Post by N612 » Thu Jan 23, 2020 10:29 pm

If you are getting good object recognition, regardless of the language setting in the AUT, I would advise against using image-based actions as this is more of a backup option when normal object recognition does not work. Image-based automation is good in Ranorex, but not nearly as good as the standard object recognition options.

If the element is being found in both languages but the clicks are missing in one language, perhaps the mouse click’s "Action spot" property needs to be adjusted to ensure it is always clicking in the "Center" of the object.

If Ranorex is not able to find the element in one language but works in another, this means the RxPath is using an attribute value that changes with the language (such as @Text=Submit changes to @Text=ngalebetkeun). It is likely possible to use a different static attribute that is the same between both languages, such as class name or a unique ID. If you are able to provide two Ranorex Snapshot files, one from two different languages, I can take a look and recommend an example RxPath that works in both languages.

priyank1989
Posts: 30
Joined: Wed Aug 14, 2019 8:59 pm

Re: Screenshot comparison with repository Item

Post by priyank1989 » Thu Jan 23, 2020 11:55 pm

N612 wrote:
Thu Jan 23, 2020 10:29 pm
If you are getting good object recognition, regardless of the language setting in the AUT, I would advise against using image-based actions as this is more of a backup option when normal object recognition does not work. Image-based automation is good in Ranorex, but not nearly as good as the standard object recognition options.

If the element is being found in both languages but the clicks are missing in one language, perhaps the mouse click’s "Action spot" property needs to be adjusted to ensure it is always clicking in the "Center" of the object.

If Ranorex is not able to find the element in one language but works in another, this means the RxPath is using an attribute value that changes with the language (such as @Text=Submit changes to @Text=ngalebetkeun). It is likely possible to use a different static attribute that is the same between both languages, such as class name or a unique ID. If you are able to provide two Ranorex Snapshot files, one from two different languages, I can take a look and recommend an example RxPath that works in both languages.
I want to compare same language screen, what is my actual issue is like If I launch my application with different language my button size will not get change based on button text ,so I just want to capture all that issues so if I have one good screenshot of all elements and its text are proper align with french language and after adding some more feature I want to perform regression on same french language build and want to make sure that all elements and its text are proper align or not as there may be a chance that my new feature implementation can change something on my old feature .. so just want to compare it with my screenshot which are perfect

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

Re: Screenshot comparison with repository Item

Post by odklizec » Fri Jan 24, 2020 9:29 am

Hi,

In my opinion, there is not an easy way to achieve what you want. You are right, that it might doable via image-based validation. But definitely not by validating entire screen or app window! Unfortunately, the only (kind of) reliable way might be validating individual buttons, which means a LOT of manual work, preparing individual reference screenshots. Eventually, it may be possible to develop a method, which takes a screenshot of each button and save it to file (relative easy task, with good xpath, returning all elements in qestion). And then you must create another method, which would read each ref. file and validate it with appropriate UI element (much harder task). In any case, there is no codeless way to achieve what you want.

The problem of validating entire screen or app window is, that even a small change in app layout, will fail your test. So the only "reliable" way is doing it by individual elements. But this will require a lot of thinking and good code.
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