Symfony Panther How to check a checkbox?

422 Views Asked by At

I'm trying this code to check a html input checkbox, but it's not working:

$this->client->findElement(WebDriverBy::cssSelector('.checkbox_additional_field_assign'))->sendKeys(true);

The checkbox:

<input name="additionalField" value="14" class="checkbox_additional_field_assign" type="checkbox">

Any idea how to do it?

1

There are 1 best solutions below

0
On

I find out the way:

$this->client->executeScript("document.querySelector('.checkbox_additional_field_assign').click()");