Selenium web driver finds element unable to find input field on the web page I tried this each and every option XPath
, by CSS
, by name. the testing site on the local environment.
HTML:
<input class="form-control ng-pristine ng-untouched ng-valid ng-empty" ng-model="email" placeholder="Username" aria-describedby="username" type="text">
xpath:
/html/body/div[2]/div/div/div[1]/div/div/div[2]/div/form/div[2]/div/div/input
css selector:
html.no-js.ng-scope body.pace-done.full-width div#wrapper div.page-wrapper.white-bg.ng-scope div.wrapper.wrapper-content.ng-scope div.login-bg.ng-scope div.container div.row div.col-sm-6.col-sm-offset-3.col-md-4.col-md-offset-4 div.login-form form.ng-pristine.ng-valid div.col-sm-12.plr10px div.form-group div.input-group input.form-control.ng-pristine.ng-untouched.ng-valid.ng-empty
driver.findElement(By.name("username"))