I apologize in advance but I am very beginner. I try to check checkbox without id or name.
Try to use click and also add Exception in case that the element is not found.
Example: If the element is not found, the find method will return null and you will try to click on null, this will throw a fatal exception and your suite will stop.
if you add an exception only the current scenario will fail and the suite will continue to execute.
public function iClick($selector, $locator){
$node = $this->getSession()->getPage()->find($selector, $locator);
if($node === null){
throw new Exception("Element $locator not found!");
}else{
$node->click();
}
}
If the element is type checkbox and you want to do a check, no matter if is checked or not, you can create a method that uses check() instead of click()
You have to use the method checkOption($option)
of MinkContext (in Behat/MinkExtension that you must install via Composer).
MinkContext is installed by default in Behat environment.
MinkContext.php
Hope it works.