title: Protractor: Get the underlying JS object of a DOM element
body: <p>I'm having following simple <code>paper-tabs</code> element and I'd like to be able to assert on this on a protractor test:</p>
  
  <pre><code>&lt;paper-tabs&gt;
      &lt;paper-tab ng-repeat='tab in tabs'&gt;
          {{tab.title}}
      &lt;/paper-tab&gt;
  &lt;/paper-tabs&gt;
  </code></pre>
  
  <p>On a protractor test I'd like to be able to do something like the following:</p>
  
  <pre><code>it('url to tab', function() {
      browser.get('#/my/url');
      var tabs = element(by.css('header paper-tabs'));
      tabs.getElement()(function(elem) {
          expect(elem.selected).toBe(0);
  
      });
  });
  </code></pre>
  
  <p>Please note that <code>selected</code> is a JS property and not an HTML attribute, as stated in the <a href="https://www.polymer-project.org/docs/elements/paper-elements.html#paper-tabs" rel="nofollow">polymer documentation</a> as well:</p>
  
  <blockquote>
    <p>Use selected property to get or set the selected tab.</p>
  </blockquote>
  
  <p>And thus following is just returning <code>null</code>:</p>
  
  <pre><code>tabs.getAttribute('selected')
  </code></pre>
  
  <p>Isn't there a way to get to the underlying JS object? For example just as I'd type in to the Chrome-Console:</p>
  
  <pre><code>&gt; document.getElementsByTagName('paper-tabs')[0].selected
  0
  </code></pre>
  
  <p>I could not find anything in Protractor's API that would serve my purpose and I wonder how others are doing this?</p>
  
  <p>Thanks!</p>