'How can I extract the text of HTML5 Constraint validation using PHP + Selenium
When incorrect value is entered in textbox next hint is appeared:

I have tried approach like for Java + Selenium . But it did not work for PHP. I did not get validation error message:
HTML:
<form action="/login" method="post" class="form-horizontal"> <input type="hidden">
<div class="form-group form-group-withLabel">
<input type="email" name="_username" id="inputEmail" required="" autofocus="" autocomplete="off">
<label for="inputEmail" class="inner-label">Email address</label>
</div>
<div class="form-group form-group-withLabel">
<input type="password" name="_password" id="inputPassword" placeholder="Password" required="">
<label class="inner-label" for="inputPassword">Password</label>
</div>
</form>
System.out.println(new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@id='inputEmail' and @name='_username']"))).getAttribute("validationMessage"));
$this->client->wait()->until(WebDriverExpectedCondition::elementToBeClickable($by));
$attr = $this->client->findElement($by)->getAttribute('validationMessage');
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
