Skip to content

Select Options By is mixing value and text SelectAttribute and wrongly returns strict mode violation #1796

@adrian-evo

Description

@adrian-evo

In the latest Browser version 12.0, this keyword behaves differently and thus it breaks some particular test cases.

I have the following combo box:
image

and when I select with:

Select Options By .cstic-required >> text=1-channel >> xpath=..//select text 0

it returns:

waiting for selector ".cstic-required >> text=1-channel >> xpath=..//select >> nth=0 >> xpath=./option[@value="1" or text()="1"]"
  strict mode violation: ".cstic-required >> text=1-channel >> xpath=..//select >> nth=0 >> xpath=./option[@value="1" or text()="1"]" resolved to 2 elements:
    1) <option value="1">0</option> aka playwright.$("text=1-channel012 >> select")
    2) <option value="2">1</option> aka playwright.$("text=1-channel012 >> select")


If I select by value or by index, the error is the same. I don't see any workaround for this situation currently.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions