diff --git a/src/lib/Browser/Locator/CSSLocator.php b/src/lib/Browser/Locator/CSSLocator.php index 22d6592e..8177cb1f 100644 --- a/src/lib/Browser/Locator/CSSLocator.php +++ b/src/lib/Browser/Locator/CSSLocator.php @@ -16,7 +16,12 @@ public function __construct(string $identifier, string $selector) { parent::__construct($identifier, $selector); $validator = new CssLocatorValidator(); - $validator->validate($this); + if (str_contains($selector, '%d') || str_contains($selector, '%s')) { + $validator->validate(new self($identifier, str_replace(['%d', '%s'], '1', $selector))); + } + else { + $validator->validate($this); + } } public function getType(): string