I've been struggling to click on a login element despite trying various methods. The source code is provided below for reference:
Source code:
<div ng-hide="IsXmlPunchOut()" class="myaccount ng-scope">
<div ng-click="Login()" class="myaccount-link">
<div class="myaccount-label">
<span class="icon-user-male" aria-hidden="true"></span>
<span class="label ng-binding">Login </span>
</div>
</div>
</div>
I'm trying to click on either the div element or the span element in order to open the login pop-up window.
Codes tried:
driver.findElement(By.cssSelector("div.myaccount-label > span.label.ng-binding")).click();
//driver.findElement(By.xpath("//div[4]/div/div/div/span[2]")).click();
//driver.findElement(By.className("icon-user-male")).click();
//driver.findElement(By.xpath("/html/body/div[1]/div[1]/div[1]/div[2]/div/div[4]/div/div/div/span[2]")).click();
//driver.findElement(By.cssSelector("body > div.wrapper > div.header > div:nth-child(1) > div.secondary-bar.ng-scope > div > div:nth-child(4) > div > div > div > span.label.ng-binding")).click();
//driver.findElement(By.cssSelector(".label.ng-binding")).click();
//driver.findElement(By.cssSelector(".myaccount-link")).click();
//driver.findElement(By.xpath("html/body/div[1]/div[1]/div[1]/div[2]/div/div[4]/div/div")).click();
driver.findElement(By.cssSelector("div.myaccount-label > span.label.ng-binding")).click();
Unfortunately, none of these methods worked. Any assistance would be greatly appreciated. Thank you!