I'm struggling with creating a protractor TypeScript code to click a button with _ngcontent and span buttontext. Does anyone have any ideas on how to achieve this? The code snippet on the site is:
<span _ngcontent-c6 class="braeting net-subheading-2"> ... </span>
<button _ngcontent-c6 class="tulbar-button net-button" net-button>
<span class="net-button-wrapper">
<span _ngcontent-c6="">Login</span>
</span>
<div class="net-button-ripple net-ripple" matripple></div>
<div class="net-button-focus-overlay"></div>
</button>
I've tried various approaches below, but I can't get it to work:
clickSignin = element(by.cssContainingText('tulbar-button net-button','Login'));
clickSignin = element(by.xpath('//span[@class="tulbar-button net-button"][_ngcontent-c6="Login"]'));
clickSignin = element(by.xpath('//span[@class="tulbar-button net-button"][text()="Login"]'));
After trying the above, I then executed:
clickSignin.click();
Unfortunately, none of the methods seem to be effective as I receive an error stating: Failed: No element found using locator: By(xpath..... or by.cssContainingText....