[RPA] Dropdown selection

25 views
Skip to first unread message

Reinaldo Neto

unread,
Jul 13, 2022, 5:37:43 PM7/13/22
to robotframework-users
Hello how are you? I would like to select the first option from the drop-down menu but I couldn’t. What would be the solution?
Sorry for my bad English.
1.png

Kalpataru sahoo

unread,
Jul 14, 2022, 12:50:02 AM7/14/22
to robotframework-users
You can use ChroPath extension there u can get actual Locator.Before clicking {  Wait Until Element Contains  } you can use or you can sleep for 10s after that perform click function from the dropdown

Julio Lemus

unread,
Jul 14, 2022, 3:59:44 PM7/14/22
to kalpat...@gmail.com, robotframework-users
Maybe it work for you

Get value from Dropdown
    [Arguments]                     ${xpath}    ${item_label}
    ${start_character} =            Get Substring    ${item_label}    0    1
    Wait Until Keyword Succeeds     ${locator_attempts}    ${locator_time}    Scroll Element Into View    ${xpath}
    Wait Until Keyword Succeeds     ${locator_attempts}    ${locator_time}    Click element    ${xpath}
    #Wait Until Keyword Succeeds     ${locator_attempts}    ${locator_time}    Press Keys    ${xpath}    ${start_character}
    Sleep                           200ms
    Wait Until Keyword Succeeds     ${locator_attempts}    ${locator_time}    Scroll Element Into View    xpath://*[(text() = "${item_label}" ) and (@role = "presentation")]
    Wait Until Element Is Visible    xpath://*[(text() = "${item_label}" ) and (@role = "presentation")]
    Mouse Over    xpath://*[(text() = "${item_label}" ) and (@role = "presentation")]
    #Wait Until Keyword Succeeds     ${locator_attempts}    ${locator_time}    Press Keys    ${xpath}    ${start_character}    ENTER
    Click element    xpath://*[(text() = "${item_label}" ) and (@role = "presentation")]
    Sleep                           ${timeToWaitDropdown}


but it requires that you send what text do you want to select

Saludos cordiales

Julio Isaías Lemus López
Ingeniero en Ciencias y Sistemas
Teléfono: (502) 5602 5000

Antes de imprimir este correo electrónico, piense bien si es necesario hacerlo: El medio ambiente es cuestión de todos.


--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/8f983f07-1622-4d34-843b-97b80cbd816fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages