How to click multiple lines and scroll down

uiautomation

#1

Hello team,

Below is my screen of an SAP cloud based application.

After Pressing GO button, 70-80 data are fetched here that I have to click the record and press button Restart. At a time only 50 records can be selected and then processed.

Can you help me in automating this selection.

I don’t know how to select these 50 records. As well as Select All, Page Up, Page Down, Home, End these keys are locked.

All I can do select record then press shift/Ctrl key and click the other record.


#2

Hi @Chand,

Have you tried to click the first row element and then send the hotkey Crtl + A?

For example:


#3

It’s locked on my screen


#4

In the Send Hotkey activity try to select the browser window by clicking on “Indicate on screen” and check if it works.


#5

Don’t have much time now, but…

Does arrow key navigation work? If yes, can you TypeInto
"[d(lshift)]" + String.Join("", Enumerable.Repeat(Of String)("[k(down)]", 50)) + "[u(lshift)]"
(that’s holding shift and pressing down arrow 50 times, you could add a small DelayBetweenKeys like 5-10 miliseconds)

Regards,
Andrzej


#6

No arrow keys are allowed. Only Shift and Ctrl Keys are allowed :unamused:


#7

Do you know something like click + shift Button + click


#8

You can add a KeyModifier to Click activity - that should solve the shift+click.

For clicking on each of them:

  1. Use FindElement activity to find the table container.
  2. Use FindChildren activity to get all rows from it (you can check Automate Challenge with getting all combo box items for an example of how to).
  3. Use a ForEach loop and in it’s body put a Click (with Shift key modifier) for each Element found. Since some elements will not be visible on screen, try using SimulateClick or SendWindowMessage methods.

Sidenote - whoever thought that SAP (of all things) can be used efficiently with essentially mouse only and that’s good UX design should rethink his actions… Especially in the day of laptops being the go-to, I can’t even imagine how it would be to work on that with a touchpad :shrugs:
It’s sad how many bad UX decisions are brought up-front by RPA.


#9

Can you help me in following 1st and 2nd steps. What type of variables should I create ?


#10

Yes It’s Ux design issue. Can you help me how to scroll down through mouse ?


#11

I’d leave that as the last resort if all else fails. Timings would be difficult to get right (click slow enough that the UI has time to scroll down but fast enough that it’s not snail-paced).
If what I’ve written below will work, you won’t need to scroll at all, just remember to use SimulateClick or SendWindowMessage method in the Click.

This will be a theory based description, as I don’t have access to that application, but let’s try.
I’ll be using this page as the base - https://en.wikipedia.org/wiki/Table_(information)

  1. Use FindElement activity to find the table container.
    Launch UiExplorer and inspect the elements on that page.
    You should be able to find something like this (assuming it really is a table):

In that picture the TABLE tag is the table container, while the TR tags hold the rows. In your application it might be a DIV tag or something else, but either way you want to find the closest common parent for all rows.
You might start with indicating the row element and moving up in hierarchy until you find something suitable.
Build a good selector for the table container element and use it as a selector in FindElement activity. In this example it will be as simple as what UiExplorer suggested, but it might differ in your application.
Store the found element in some variable, I’ve called it containerElement.

  1. Use FindChildren activity to get all rows from it.
    This is the configuraion of FindChildren I’ve used for this example:

You want to put the containerElement as the Target -> Element (since it should look for things nested under it).
Filter is a common property for all things you want to find. In this case it’s simply web controls tagged TR. This you need to inspect with UiExplorer as well, as it probably will be different.

Scope is set to FIND_DESCENDANTS.
There are 2 choices that might be relevant here (other being FIND_CHILDREN). Difference is that CHILDREN are only direct (1st level nesting). In that page that would only cover CAPTION and TBODY elements. DESCENDANTS is everything that is nested under it, no matter how deep. Since we need 2nd level nesting, we need to use that.

Now you have a IEnumerable(Of UiElement) which you can use in a ForEach loop. Rest should be pretty easy :slight_smile:

Attached you can find an example that does a little more (reads the cells, builds a datatable etc.) that could also prove useful. If you just need to click each row, put your Click activity where the example is reading cells.
DataTableTest.xaml (16.7 KB)
Sidenote - the example skips 1 row, that’s specific to that table, since the header row is a TR as well.

If you’re stuck with any of the steps, try to find relevant materials in the Resources section and/or ask away.

Regards,
Andrzej


#12

This webpage opens with SilverLight :confused: