} catch (ElementNotFoundException $e) {
// Multi element settings, interacting only the first one.
- $fieldxpath = "//*[label[.= $label]|span[.= $label]]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
- "/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
+ $fieldxpath = "//*[label[normalize-space(.)= $label]|span[normalize-space(.)= $label]]/" .
+ "ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
+ "/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select]" .
+ "[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
$fieldnode = $this->find('xpath', $fieldxpath);
// It is the same one that contains the type.