I am doing this:
WebElement userName = driver.findElement(By.id("username"));
but I get:
Unable to locate element: #username
My DOM looks like this:
<input type="text" name="username" id="username" class="u-leader-m10"
required="required" tabindex="1">
From the looks of it, everything is alright. So, what are some areas to investigate this failure? Happy to provide more info. I just don't know what can be relevant.
Edit: I've tried 'name' instead of 'id' and it's working - still confused!