Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions atest/test/02_Content_Keywords/select_lists.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions node/dynamic-test-app/static/prefilled_email_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@
<option value="others">Others</option>
</select>
</td>
<td>Select without value:</td>
<td>
<select id="noValue">
<option>Option 1</option>
<option>Option 2</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="submit"/></td>
Expand Down
2 changes: 1 addition & 1 deletion node/playwright-wrapper/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down