Select cell from highlighted row

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

Select cell from highlighted row

Post by joebartt » Wed Aug 30, 2017 8:42 pm

What I'm trying to accomplish:

Find a row in a grid that matches a name(first column).
Select/Highlight the row (tricky because everything in the row is clickable and opens a window).
Click on other cells in the row (at this point its ok for windows to open).

I have figured out steps 1 and 2 but I am stuck on step 3. The elements in the grid do not seem to be related to each other so its difficult to use sibling or find common attributes.

The snapshot will not attach since it is slightly larger than 1 meg and zipping it doesn't reduce size very much. I can email directly.

Any input is greatly appreciated.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Select cell from highlighted row

Post by krstcs » Wed Aug 30, 2017 9:25 pm

If you want, you can upload the file to OneDrive or DropBox (or similar) and post the link. Another option is to set spy to only save the table and not save everything else.

Most of the time, either the table object, or the row itself, will have an indicator for "IsSelected" or something like that. But without seeing your setup, it's only a guess as to whether or even if yours does.
Shortcuts usually aren't...


krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Select cell from highlighted row

Post by krstcs » Thu Aug 31, 2017 1:28 pm

So it looks like this is not a standard table/row setup.

My suggestion would be to use the @backgroundcolor attribute as it is different for the selected row. You might want to use [@backgroundcolor!='#FFFFFFFF'] so you get the one that isn't white, in case they change the selected color.

In addition, make sure that you remove as many of the indexes ("element[1]" -> "element[@someattribute='somevalue']) as possible because they can cause issues if the UI is changed.
Shortcuts usually aren't...

joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

Re: Select cell from highlighted row

Post by joebartt » Thu Aug 31, 2017 1:38 pm

Thanks for your input. I'll see if I can make something work.

joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

Re: Select cell from highlighted row

Post by joebartt » Thu Aug 31, 2017 3:08 pm

I do believe I got it to work. I could not find backgroundcolor attribute so instead I used foregroundcolor attribute and used that, as well as manipulating the index values for the correct column and removing the index for the row. So in a nutshell, I had it look for and click on button in column index 2 where foregroundcolor = #FFFFFFFF, which would only be in the highlighted row. thanks again for the suggestion!

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Select cell from highlighted row

Post by krstcs » Thu Aug 31, 2017 3:16 pm

Great!

It is weird that you didn't see BackgroundColor because I could see it in the snapshot. But maybe I was looking a little higher or lower in the dom tree than you are working.

Anyway, glad you found a solution that worked for you.
Shortcuts usually aren't...