title: How to fetch element with 'name' attribute in react-testing-library
body: <p>I'm testing my react app with react testing library and jest.</p>
  <p>And I want to know how to fetch element with 'name' attribute in react-testing-library.</p>
  <p>For example, in the following page, is it possible to fetch this element with &quot;userName&quot;?</p>
  <pre class="lang-html prettyprint-override"><code>&lt;input type=&quot;text&quot; name=&quot;userName&quot; /&gt;
  </code></pre>
  <p>Or should I set <code>data-testId</code> into the element and use <code>getByTestId</code> method?</p>
  <pre class="lang-js prettyprint-override"><code>return (
    &lt;div&gt;
      &lt;input type=&quot;text&quot; name=&quot;userName&quot; /&gt;
    &lt;/div&gt;
  )
  </code></pre>