Skip to content

Get Text Keyword returns value attribute instead of the text of an option element #4953

@OkuRobot

Description

@OkuRobot

Describe the bug
I have noticed a behavior change in "Get Text" Keyword from version 19.12.0 to 20.0.0

To Reproduce
sample_adress_form.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>City Selection</title>
    </head>
    <body>
        <div class="city-field">
            <label for="city">City</label>
            <select id="city" name="city">
                <option value="value_1">Berlin</option>
            </select>
        </div>
    </body>
</html>

potetntial_bug.robot

*** Settings ***
Library     Browser  


*** Test Cases ***
Select Berlin From Dropdown
    [Documentation]    Opens the sample page and selects 'Berlin' from the city dropdown.
    New Browser  chromium  headless=False
    New Page  ${CURDIR}${/}sample_adress_form.html
    ${city_text}  Get Text    select#city  
    Should Be Equal   ${city_text}  Berlin    
    Close Browser`

Expected behavior
With Version 19.12.0 this test passes
With Version 20.0.0 we get the error message "value_1 != Berlin"

Screenshots

Image

**Desktop

  • OS: Windows Windows 11 Pro
  • Browser Chrome for Testing
  • Version 148.0.7778.96 (Official Build) (64-bit)

Additional context
Slack Channel message https://robotframework.slack.com/archives/C015KB1QSDN/p1781012172157479?thread_ts=1780896883.081299&cid=C015KB1QSDN

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions