david001's avatar

click checkbox in laravel dusk

Hi, I am not able to check the check in laravel dusk. I tried a lot of ways. Can you please help me.?


<div class="checkbox custom-checkbox">
                    <input id="schedule-files-report-export-toggle" name="schedule_enabled" type="checkbox" value="1">
                    <label for="schedule-files-report-export-toggle">&nbsp;&nbsp;Automatically email me the CSV report of files periodically.</label>
                </div>

i did this ->check("input[name='schedule_enabled']") but it didn't worked.

0 likes
1 reply
bugsysha's avatar

Do you have multiple checkboxes with the same name? Maybe hidden or something? If the id attribute is unique (as it should be), then try using that.

$browser->check('schedule-files-report-export-toggle');

or

$browser->check('#schedule-files-report-export-toggle');

Please or to participate in this conversation.