I'm new to protractor and trying write a script. But every time I try to locate an element "The Element not found
" error is coming.
These are the error messages I'm getting:
Failed: No element found using locator: By(xpath, //*[@id="firstName"])
Failed: No element found using locator: By(css selector,*[id="firstName"])
I have tried below codes. But everything is failing.
element(by.xpath('//*[@id="firstName"]')).sendKeys('Mátyás');
element(by.id('firstName')).sendKeys('Mátyás');
browser.findElement(by.id('firstName')).sendKeys('Mátyás');
This is the element I'm trying to access.
<input _ngcontent-c9="" class="form-control ng-pristine ng-invalid ng-touched" formcontrolname="firstName" id="firstName" name="firstName" type="text" ng-reflect-name="firstName" placeholder="First Name">
What am I doing wrong?