Select Option

Hi im trying to select one option in drop down list, UiPath cant recognize the list

<select class="SELstd" id="BLK_MSVWS_MSDINBRS__SUPPRESS_MESSAGE" label_value="Suppress Message" title="Suppress Message" dbt="BLK_MSVWS_MSDINBRS" dbc="SUPPRESS_MESSAGE" name="SUPPRESS_MESSAGE" dtype="VARCHAR2" size="1" required="" aria-required="false"><option value="" selected="" default=""></option>
<option value="H">Suppress Msg Generation</option>
<option value="N">No Suppress</option>
<option value="F">Suppress Full</option></select>

how to deal with this case, im trying to write attribute value but couldn’t manage it.
BR
Hazem

Im try to use JS

@"function (BLK_MSVWS_MSDINBRS__SUPPRESS_MESSAGE, input) {
    
    var selectElement = document.getElementById(""BLK_MSVWS_MSDINBRS__SUPPRESS_MESSAGE"");
    
    
    if (selectElement) {
      
        selectElement.value = 'F';
    } else {
        console.error('Element not found');
    }
}"

but cant change the value on it

there are many strategies possible:

#1 - TwoClick flow:

  • first click - expand the dropdown
  • second click - use click activity where value attribute is used with a dynamic selector

#2 - Find Children

  • get all option children
  • filter on the children with the needed “value attribute” - value/content
  • use found option for the select item

Thanks for answering

the first option i seen on another post was traying but can see the element itself more is sees a box of options.

the second option, when i try to get attribute its return null

im trying to iject JS since I always choose option F but my code above is not really triggered

it is up to you how much you share with us. With more details, we can address more specific

the value attribute is not part of the offered selector attributes and we have to dynamize it on css-selector base. Maybe you can share the link, which is implementing this and you had seen

we dont know what was modelled in detail. So ensure that find children is used correctly (e.g. filter)

As an alternate to above:

The dropdown:
grafik

the flow:

the selector for the get Attribute:
grafik

And its Default Value for the evaluations:

  • we get with the option value the value text - CarB → Saab
  • and select with Saab within the dropdown

Thanks alot but I cant select Item

the indicated target is not valid UI element for selectItem,

I found solution to click then pagedown to select what i need the i do get text to verify, but i really to know how use inject JS on this

@Hazem_Saleh

would have a root cause for which we inspect the defined selectors. Above we used Select item and when working with your snippet HTML we can also use select item

The above described similar flow:

running against your HTML select Snippet:

is using the the Select Item Activity and selects the option for the filtered / calculated option Value: “N” → No Suppress

So from our end we made it working and do not see a technical blocker.

About:

It is up to you to choose any other modelling option, as there are multiples available. We would just encourage to checkout root causes when proofed implementations did work. But we suggest not to missmatch

  • |-- not working in general --|

with

  • |-- not working within an unclear modelling --|

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.