After searching extensively, I am still struggling to find a way to locate a specific button on a webpage that lacks a unique identifier in the HTML. There are three buttons on the page, and the one I need to identify is the second one. Despite trying various methods and consulting multiple online resources, I have not been successful. Here are some of the approaches I have attempted:
element.all(by.css('[type="button"]')).get(1).click();
element.(by.xpathy('//div [@ng-click="addAdminForm()"]')).click();
$$('[ng-click="addAdminForm()"]').click();
element.all(by.css('.adminportal-submit-button')).get(0).click();
I would greatly appreciate any assistance that can be provided. Thank you in advance.
<div class="layout-align-start-center layout-row flex">
<button class="md-primary adminportal-cancel-button md-button md-ink-ripple" ng-transclude="" type="button" ng-click="gotoHomePage()" ng-disabled="disableButtons" analytics-on="" analytics-category="Clinics" analytics-event="cancel" tabindex="0" aria-disabled="false">
</div>
<div class="layout-align-end-center layout-row">
<button class="md-raised md-primary adminportal-submit-button md-button md-ink-ripple" ng-transclude="" type="button" ng-click="addAdminForm()" ng-disabled="manageClinicForm.$invalid || disableButtons" analytics-on="" analytics-category="Clinic-Admins" analytics-event="register" tabindex="0" aria-disabled="false">
<button class="md-raised md-primary adminportal-submit-button md-button md-ink-ripple" ng-transclude="" type="submit" ng-disabled="manageClinicForm.$invalid || disableButtons" aria-disabled="false">