From 63a939b1e3b1a80f0faba383e93d5b802625f3b1 Mon Sep 17 00:00:00 2001 From: Daniel Haupt Date: Thu, 9 Dec 2021 17:39:41 +0100 Subject: [PATCH] Select only necessary fields for submitForm() This changes the selector of fields used in `submitForm()` to get only fields with a `name` attribute. Fixes: #83 --- src/Codeception/Module/WebDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index 69354ae..cd0c01b 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -2427,7 +2427,7 @@ public function submitForm($selector, array $params, $button = null) $form = $this->matchFirstOrFail($this->getBaseElement(), $selector); $fields = $form->findElements( - WebDriverBy::cssSelector('input:enabled,textarea:enabled,select:enabled,input[type=hidden]') + WebDriverBy::cssSelector('input:enabled[name],textarea:enabled[name],select:enabled[name],input[type=hidden][name]') ); foreach ($fields as $field) { $fieldName = $this->getSubmissionFormFieldName($field->getAttribute('name'));