kalqlx
kalqlx

Reputation: 25

How to automate to click a button which has no ID

<div class="add" data-icon="'" ng-show="!editMode" ng-click="btnAdd()"> Add an Honor or Award </div> Above is the html code for the button i am trying to click (Add an Honor or Award), but this button doesn't have an unique ID, and keeps on changing the xpath as the user adds multiple data.

Upvotes: 2

Views: 682

Answers (1)

Saifur
Saifur

Reputation: 16201

Use css

[class='add'][ng-click='btnAdd()']

xpath is also another option

//div[contains(.,'Add an Honor or Award')]

Or,

//div[@class='add']

Upvotes: 4

Related Questions