This thread is trying to answer question "How can I handle multiple checkbox selection with index value?"
@Jessey Alan Paul S you can try below code
// Get the total number of checkboxes const totalCheckboxes = await page.locator('input[type="checkbox"]').count();
// Iterate over the checkboxes on their index
for (let i = 0; i < totalCheckboxes; i++) {
const checkbox = await page.locator(#language-option-${i}-checkbox
);
await checkbox.check();
}
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].