1

Per the attachment, I'm using this statement "private readonly By _idTxt = By.XPath(".//*[@class='metric-set-details-dropdown']/../button[ng-reflect-value]");" in hope of capturing the value for the attribute ng-reflect-value for an assert test but my test run is failing with "OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":".//*[@class='metric-set-details-dropdown']/../button[ng-reflect-value]"}"

Any input is appreciated!

Thanks, Tienenter image description here

Tien
  • 159
  • 1
  • 3
  • 10

1 Answers1

1

FYI you should not rely on ng-reflect-* since angular add these attributes only for debugging purpose. Still if you need it, then see: https://stackoverflow.com/a/44469527/9709887

Vishnu Singh
  • 431
  • 4
  • 13
  • Thank you very much for your help. I'm very new at this and glad to learn that ng-reflect-* is meant for debugging only. The developer used to provide the value I needed with xxxxxxx with which an earlier test with By.XPath(".//*[@class='metricId']") worked. Since changes to the UI has the metric ID now in ng-reflect-value, I'll figure a different way of acquiring the value for my assert test. Thanks again for your help! – Tien Sep 09 '18 at 20:07