title: protractor No element found using locator: By(xpath,
body: <p>Actually I am testing in browser directly and I am getting error saying no element found using locator. </p>
  
  <p>spec.js</p>
  
  <pre><code> it('Test for Application Registration text', function () { 
       var ar = browser.findElement(by.xpath('/html/body/admin-app-root/layout/div[1]/cheader/nav/div/div[1]/a[2]'));
       expect(ar.getAttribute('value')).toEqual('Application Registration'); 
   });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div _ngcontent-bbu-25="" class="navbar-header"&gt; 
   &lt;a _ngcontent-bbu-25="" class="navbar-brand logo navbar-brand-logo" href="/register/core/feature-list"&gt;&lt;/a&gt; 
   &lt;a _ngcontent-bbu-25="" class="navbar-brand navbar-brand-title app-title ellipses" href="/register/core/feature-list"&gt;Application Registration&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Message:[chrome #01]     Failed: no such element: Unable to locate element:
  {"method":"xpath","selector":"/html/body/adminapproot/layout/div[1]/
  cheader/nav/div/div[1]/a[2]"}[chrome #01]       
  (Session info: chrome=61.0.3163.100)[chrome #01]      
  (Driver info:chromedriver=2.32.498550(9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),
   platfor=Windows NT 10.0.14393 x86_64)[chrome #01]   
   Stack:[chrome #01]   NoSuchElementError: no such element: Unable to locate 
   element:{"method":"xpath","selector":"/html/body/admin-app-
   root/layout/div[1]/cheader/nav/div/div[1]/a[2]"}[chrome #01]       
  (Session info: chrome=61.0.3163.100)[chrome #01]       
  (Driver info:chromedriver=2.32.498550(9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),
   platfor=Windows NT 10.0.14393 x86_64)[chrome #01]        
   at WebDriverError(C:\\node_modules\proractor\node_modules\selenium-
   webdriver\lib\error.js:27:5)
  </code></pre>