Page 1 of 1

Select cell from highlighted row

Posted: Wed Aug 30, 2017 8:42 pm
by joebartt
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.

Re: Select cell from highlighted row

Posted: Wed Aug 30, 2017 9:25 pm
by krstcs
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.

Re: Select cell from highlighted row

Posted: Thu Aug 31, 2017 1:20 pm
by joebartt

Re: Select cell from highlighted row

Posted: Thu Aug 31, 2017 1:28 pm
by krstcs
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.

Re: Select cell from highlighted row

Posted: Thu Aug 31, 2017 1:38 pm
by joebartt
Thanks for your input. I'll see if I can make something work.

Re: Select cell from highlighted row

Posted: Thu Aug 31, 2017 3:08 pm
by joebartt
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!

Re: Select cell from highlighted row

Posted: Thu Aug 31, 2017 3:16 pm
by krstcs
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.