Page 1 of 1

Absolute Click

Posted: Thu Oct 10, 2019 2:07 pm
by WesleyWest
I am having issues with seeing a check box so it can be clicked.

This is a grid with headers
Currently what we do in a recording is
Get the Column: Searches the header for the name we select. In this case it's "Warehouse" (rawtext[@rawtext='Warehouse'])
Get the Row: We need to figure out which row based on the user which is the first column. In this case it's a variable. (rawtext[@column=$Column and @rawtext=$AssignedUser]
We then combine the 2 to either validate or click. (rawtext[@column=$Column and @row=$Row])

This works great in multiple situations and we use it a lot. It will find the row based on a user defined by a variable and the column based on the header name.

However, sometimes we have situations where there is a check box or a empty field and the repository doesn't find the cell. In the situation that brought on this post we need to click a checkbox that is either checked or unchecked but ranorex doesn't see it so it wont click.

My question is: I want to be able to click on a absolute position that doesn't rely on anything other than column + row.


Any help would be appreciated

Re: Absolute Click

Posted: Thu Oct 10, 2019 2:14 pm
by odklizec
Hi,

Please upload a Ranorex snapshot (NOT screenshot) of the UI, showing the problematic situation. It's hard to suggest something reliable without seeing, at very least, Ranorex snapshot.

RAW text-based automation is quite tricky. So it there is no other way how to detect certain UI element, you will most probably have to use image-based automation? But as mentioned, it's hard to tell for sure, without seeing the snapshot. Thanks.

Re: Absolute Click

Posted: Thu Oct 10, 2019 2:23 pm
by WesleyWest
Sorry about that, I attached it to this post.

Thanks!

Re: Absolute Click

Posted: Fri Oct 11, 2019 7:47 am
by odklizec
Hi,

You can, of course, use absolute coordinates in Click action. Unfortunately, there appears to be no way to tell, if the checkbox is checked or not. Plus the position of checkbox you want to click can be only assumed, based of selected header cell coordinates? For example, if you get coordinates (client rectangle) of column Warehouse, you will see this:
Warehouse_Coord.png
With this you know the position and size of Warehouse column...
x=227, y=5, w=51, h=17
And belonging checkbox is right under it. So all you have to do, is to change the Y position of obtained header element, with its Y value + height of header cell + some overhead (e.g. +5 pixels?). This should give you position of cell with checkbox...
x=227, y=27, w=51, h=17
And then you need to calculate center of this cell, where...
x=227+(51/2)
y=27+(17/2)
This should give exact center of checkbox cell, which belongs to Warehouse column. Hope this helps? ;)

Re: Absolute Click

Posted: Fri Oct 11, 2019 7:51 am
by McTurtle
Hello WesleyWest,

odklizec is exactly right with the coordinates.

Once you have the coordinates of the checkbox, you could expand that to a range and use image based automation in order to verify if the section contains a image of a checked or un-checked checkbox. This is not very easy, but I don't really see a different way.

Regards,
McTurtle