How to locate multiple class other than css selector?

How to locate multiple class other than css selector?

for reference :
<a class=”btn btn-primary” ng-class=”{ ‘btn-editmode’ : basket.isEditBasket }” ng-click=”updateBasket( $event, product, 1, ‘ProductDetail’ )” title=”buy”>buy</a>

Default Asked on March 18, 2015 in Selenium WebDriver.
Add Comment
  • 3 Answer(s)

    By.ClassName(“.btn.btn-primary”);

    Professor Answered on March 18, 2015.
    Add Comment

    It’s not working

    Default Answered on March 18, 2015.
    Add Comment

    If By.ClassName contains spaces then it won’t work.

    Use By.xpath(“//a[@class=’btn btn-primary’]”)

    Default Answered on March 18, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.