Select item works visually, but doesn't take selected value

rpav

New Member
Good day everyone,

I'm trying to select particular item from the select box and the problem I face is that although item is visually selected when process runs, whenever the action OK is taken the old default value is used from select box, not the one chosen by the process.

The issue is duplicated with different programs:
- select printer of the standard Ctrl+P dialog in Adobe Reader
- another proprietary independent Windows application (during log in)

What I tried:
- write value directly to select box element
- Select item defining by order number
- Select item defining by text value
- Select item defining both number and text

There is no error message reported, the element is properly identified and value is properly selected, however, when I click "Print" or "Log in" button, the old value from select box is used (e.g. default or selected previously manually). When I manually select the proper field, it works just fine. The problem is only when run under BP.

Has anybody faced the same issue? Any advice?

Thank you!
 

rpav

New Member
As a follow up:

It was not working when Element was spied with win32 or UIA mode, however, when I selected combo box with AA mode, then it started to work with simple "Select item" method.

But a new problem appeared, as it works for English OS, however, for German OS it breaks with an error:

"Unexpected default action of 'Öffnen' on combo box's button"

The only action used is "select item":
View attachment 20181127_select_item.png

Any advice on how to overcome language settings with AA combo box?
 
If it doesn't work with select with text value, you could try simply -- activating window, global mouse clicking into the field and global send keys with the text you need to select.
 

rpav

New Member
If it doesn't work with select with text value, you could try simply -- activating window, global mouse clicking into the field and global send keys with the text you need to select.

Thanks for suggestion, there are two issues with this approach:
- if the value is not in the list, instead of process interruption, there will be something else selected
- with second program it didn't work anyways, in the way when input is given manually it just enters text, not actually selects from the list (there is some strange listbox honestly).

What I did as a workaround for future reference if someone has similar issue was:

- read all values from dropdown list (into collection).
- go over collection and find index of the value required to be selected (if not present --> Exception).
- global send keys {UP} as many times as there are total number of elements in collection, that guarantees that I start from the very top of the list.
- global send keys {DOWN} as many times as index found above.

In this way the proper value is selected at the end.
 

VJR

Well-Known Member
Thanks for suggestion, there are two issues with this approach:
- if the value is not in the list, instead of process interruption, there will be something else selected
- with second program it didn't work anyways, in the way when input is given manually it just enters text, not actually selects from the list (there is some strange listbox honestly).

What I did as a workaround for future reference if someone has similar issue was:

- read all values from dropdown list (into collection).
- go over collection and find index of the value required to be selected (if not present --> Exception).
- global send keys {UP} as many times as there are total number of elements in collection, that guarantees that I start from the very top of the list.
- global send keys {DOWN} as many times as index found above.

In this way the proper value is selected at the end.
It's true that certain controls are different and hence have a different behaviour and that you've found a workaround.
A tip is, if you are not already using it, then you can use a number to navigate the down key those many times.
eg; "{ENTER 5}" will send Enter 5 times.
So in your case you can add a data item and pass it as below
"{DOWN " & [Times] & "}"
This works with GSK, but you need to check if it works with GSK Events too, if that is what you are using.
Cheers.
 
Thanks for suggestion, there are two issues with this approach:
- if the value is not in the list, instead of process interruption, there will be something else selected
- with second program it didn't work anyways, in the way when input is given manually it just enters text, not actually selects from the list (there is some strange listbox honestly).

I have just put a wait stage for the dropdown menu (with html or AA, whatever worked for me) and click there only when visible. :)
 

rpav

New Member
It's true that certain controls are different and hence have a different behaviour and that you've found a workaround.
A tip is, if you are not already using it, then you can use a number to navigate the down key those many times.
eg; "{ENTER 5}" will send Enter 5 times.
So in your case you can add a data item and pass it as below
"{DOWN " & [Times] & "}"
This works with GSK, but you need to check if it works with GSK Events too, if that is what you are using.
Cheers.

I tried to redo to simplify the process as per your suggestion. I used GSK, not GSK Events and it work only when executed manually with step by step manual iteration.
However, when launched in automated way, the proper value in list is not selected.
I assume the issue is that there should be a short wait period between each click. I tried to add interval = 0.1, but get:

"Internal : Failed To perform Step 1 In Navigate Stage 'Click Up' on page 'XXX' - Special characters (~{}+^%) are not supported in SendKeys if an interval value is provided. Separate calls can be used to send control characters."

The exception doesn't make much sense, why could not user define interval between sending special keys? But I assume this is what we get from Blue Prism and doing loops is the only way here.
 

VJR

Well-Known Member
I tried to redo to simplify the process as per your suggestion. I used GSK, not GSK Events and it work only when executed manually with step by step manual iteration.
However, when launched in automated way, the proper value in list is not selected.
I assume the issue is that there should be a short wait period between each click. I tried to add interval = 0.1, but get:

"Internal : Failed To perform Step 1 In Navigate Stage 'Click Up' on page 'XXX' - Special characters (~{}+^%) are not supported in SendKeys if an interval value is provided. Separate calls can be used to send control characters."

The exception doesn't make much sense, why could not user define interval between sending special keys? But I assume this is what we get from Blue Prism and doing loops is the only way here.
Hi rpav,

Wait can be absolutely used before and after the Sendkeys. Maybe it needs proper focus. Are you very sure that the parameters of Sendkeys were correctly given and the error could really mean something? A small thing as a space could also cause never ending troubles. You need not modify the entire diagram but try it out by copy pasting on a separate page for future purposes. But if you are happy with your current diagram then you can ignore my post.
 
Top