I am trying to send information to a textfield and I am having difficulties locating it. There are multiple elements with the same name and it's difficult to find it.
<div class="form-group">
<label for="username">LDAPTEST Username</label>
<input type="text" name="username" id="username" class="form-control top" title="This field is required." autofocus="autofocus" data-qa-selector="username_field" required="required">
<p class="gl-field-error hidden">This field is required.</p>
</div>
I have tried the following:
username_By = By.id("username")
username_By = By.cssSelector("input[data-qa-selector='username_field']")
I am getting TimeoutException when I am waiting for the visibility of the element.
wait.until(ExpectedConditions.visibilityOfElementLocated(username_By));
Any suggestions on how to locate the element? Thanks