Can anyone help me locate the element with the tag
<span _ngcontent-c19=""> ACME Nursing </span>
using Xpath or any other method?
I have attempted various ways to use actions in order to moveToElement, as well as other methods, but I am unable to perform the hover and click action. I have also tried using waits, but I keep encountering the same error message regardless of the approach I take:
Below is the snippet of code containing the hidden element I am trying to find:
<acme-role-facility _ngcontent-c2="" class="ng-tns-c2-1" _nghost-c20="">
<li _ngcontent-c20="" class="header-item show dropdown" ngbdropdown=""><a _ngcontent-c20="" aria-haspopup="true" class="dropdown-toggle dropdown-toggle" href="javascript:void(0)" id="roleFacilityDropdown" ngbdropdowntoggle="" aria-expanded="true"><span _ngcontent-c20="" class="block m-t-xs" id="roleFacilityName"><span _ngcontent-c20="">ACME Nursing - </span></span><span _ngcontent-c20="" class="block"><span _ngcontent-c20="">Nursing Admissions</span><b _ngcontent-c20="" class="caret"></b></span></a>
<aht-navigation
_ngcontent-c20="" aria-labelledby="roleFacilityDropdown" ngbdropdownmenu="" _nghost-c19="" class="dropdown-menu show" x-placement="bottom-left" style="top: 52px; left: 0px;">
<perfect-scrollbar _ngcontent-c19="" class="nav-facility-container">
<div style="position: static;" class="ps">
<div class="ps-content">
<!---->
<div _ngcontent-c19="" class="animated fadeInDown light ng-star-inserted" style="">
<!---->
<ul _ngcontent-c19="" class="nav navbar-nav ng-star-inserted">
<!---->
<li _ngcontent-c19="" class="ng-star-inserted">
<!---->
<!---->
<!----><a _ngcontent-c19="" href="javascript:void(0)" class="active parent-menu dropdown-item ng-star-inserted"><span _ngcontent-c19=""> ACME Nursing </span><i _ngcontent-c19="" class="chevronMargin fa fa-chevron-right"></i></a>
<!---->
<!---->
<!---->
<!---->
</li>
<!-- More li elements with similar structure... -->
</ul>
</div>
</div>
<!---->
<div class="ps__rail-x" style="left: 0px; bottom: 0px;">
<div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div>
</div>
<div class="ps__rail-y" style="top: 0px; right: 0px;">
<div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 0px;"></div>
</div>
</div>
</perfect-scrollbar>
<!---->
</aht-navigation>
</li>
</acme-role-facility>
This is the error message I am receiving:
**Unhandled Exception: OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"id","selector":".//span[starts-with(@id,'ACME Nursing')]"}
(Session info: chrome=72.0.3626.109)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17134 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementById(String id)
at OpenQA.Selenium.By.<>c__DisplayClass16_0.<Id>b__0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
at AHT.Browser.FacilityRoleSelect() in C:\Users\che7592\Documents\Visual Studio 2017\Projects\AHT\AHT\Program.cs:line 72
at AHT.Program.Main(String[] args) in C:\Users\che7592\Documents\Visual Studio 2017\Projects\AHT\AHT\Program.cs:line 33**