button location error using xpath urgent?

gagak

New Member
I have to test a dynamic app using i have a button like that\[code\] <button class="btn btn-primary btn-mini" ng-click="addAnswer(question)" ng-show="question.editing">Add Answer</button>\[/code\]i was trying to locate button with that but i failed \[code\]getDriver().findElement(By.xpath("//img [@ng-click='addAnswer(question)']")).click();\[/code\]using css \[quote\] List AddAnswerBtn = getDriver().findElements(By.className("btn-primary")); AddAnswerBtn.get(0).click();\[/quote\]give me correct line to locate it.. i dont wants to locate it using class and i wants to use xpath to locate button location
 
Top