diff --git a/atest/test/02_Content_Keywords/select_lists.robot b/atest/test/02_Content_Keywords/select_lists.robot index e2782581a..5e59593c7 100644 --- a/atest/test/02_Content_Keywords/select_lists.robot +++ b/atest/test/02_Content_Keywords/select_lists.robot @@ -21,7 +21,7 @@ Get Select Options Get Select Options Strict Run Keyword And Expect Error - ... *strict mode violation*//select*resolved to 3 elements* + ... *strict mode violation*//select*resolved to 4 elements* ... Get Select Options //select Set Strict Mode False ${options} = Get Select Options //select @@ -97,6 +97,9 @@ Select Options By With Nonmatching Selector ... notamatch label False Label [Teardown] Set Browser Timeout ${PLAYWRIGHT_TIMEOUT} +Select Options By Text When Select Does Not Have Value Attribute + Select Options By id=noValue text Option 2 + Deselect Options Implicitly Select Option And Verify Selection text select[name=possible_channels] @@ -106,7 +109,7 @@ Deselect Options Explicitly Deselect Options With Strict Run Keyword And Expect Error - ... *strict mode violation*//select*resolved to 3 elements* + ... *strict mode violation*//select*resolved to 4 elements* ... Deselect Options //select Set Strict Mode False Deselect Options //select diff --git a/node/dynamic-test-app/static/prefilled_email_form.html b/node/dynamic-test-app/static/prefilled_email_form.html index 847ab95e0..94cb76eb4 100644 --- a/node/dynamic-test-app/static/prefilled_email_form.html +++ b/node/dynamic-test-app/static/prefilled_email_form.html @@ -73,6 +73,13 @@ + Select without value: + + + diff --git a/node/playwright-wrapper/interaction.ts b/node/playwright-wrapper/interaction.ts index dc9909285..181f6aaa3 100644 --- a/node/playwright-wrapper/interaction.ts +++ b/node/playwright-wrapper/interaction.ts @@ -38,7 +38,7 @@ export async function selectOption( const attributeName = Object.keys(matcher[0])[0]; const selectedOptions = []; for (const selectedOption of result) { - const locatorOptions = locator.locator(`option[value="${selectedOption}"]`); + const locatorOptions = locator.locator(`//option[@value="${selectedOption}" or text()="${selectedOption}"]`); const element = await locatorOptions.elementHandle(); exists(element, `The ${selectedOption} option element did not exist.`); selectedOptions.push(String(await element.getProperty(attributeName)));