Search code examples
protractorelementtitle

protractor get div element by title


What is the best way to find a div element by his title, 'ACTIVITY_1':

<div class="col-xs-3 no-margin no-padding type..." data-ng-class="..." data-ng-click="..." title="ACTIVITY_1" 

thx


Solution

  • You can use a CSS selector:

    element(by.css('div[title=ACTIVITY_1]'));
    

    Or, with a $ shortcut:

    $('div[title=ACTIVITY_1]');