title: Found multiple elements error in React Testing Library
body: <p>Im having a problem with a query, I'm trying to get two radio inputs, I don't have any problem with one of them, but with the other one React Testing Library thrown an error: <code>It Found multiple elements with the role &quot;radio&quot; and name /to/i:</code></p>
  <h2>queries</h2>
  <pre class="lang-js prettyprint-override"><code>test('Render form with default items', () =&gt; {
    const handleUpdateValue = jest.fn();
    const handleNextStep = jest.fn();
    render(
      &lt;Form
        handleNextStep={handleNextStep}
        updateValue={handleUpdateValue}
        transferFundsValues={{}}
      /&gt;
    );
  
    const amountInput = screen.getByLabelText(/amount/i);
    const fromRadio = screen.getByLabelText(/from/i);
    const toRadio = screen.getByLabelText(/to/i);
    const messageInput = screen.getByLabelText(/message/i);
  
    const continueButton = screen.getByRole('button', { name: /continue/i });
    const cancelButton = screen.getByRole('button', { name: /cancel/i });
  
    // If no value has been entered to the inputs, the continue button must be
    // disabled
    expect(continueButton).toBeDisabled();
  });
  </code></pre>
  <h2>Html structure</h2>
  <pre class="lang-html prettyprint-override"><code>&lt;label for=&quot;transferFunds_from&quot; class=&quot;ant-form-item-required&quot; title=&quot;From&quot;&gt;From&lt;/label&gt;
  &lt;input id=&quot;transferFunds_from&quot; type=&quot;radio&quot; class=&quot;ant-radio-button-input&quot; value=&quot;&quot;&gt;
  
  &lt;label for=&quot;transferFunds_to&quot; class=&quot;ant-form-item-required&quot; title=&quot;To&quot;&gt;To&lt;/label&gt;
  &lt;input id=&quot;transferFunds_to&quot; type=&quot;radio&quot; class=&quot;ant-radio-button-input&quot; value=&quot;&quot;&gt;
  </code></pre>
  <h2>Error thrown by RTL</h2>
  <pre class="lang-sh prettyprint-override"><code> TestingLibraryElementError: Found multiple elements with the role &quot;radio&quot; and name `/to/i`
  
      Here are the matching elements:
  
      &lt;input
        class=&quot;ant-radio-button-input&quot;
        id=&quot;transferFunds_from&quot;
        type=&quot;radio&quot;
        value=&quot;&quot;
      /&gt;
  
      &lt;input
        class=&quot;ant-radio-button-input&quot;
        id=&quot;transferFunds_to&quot;
        type=&quot;radio&quot;
        value=&quot;&quot;
      /&gt;
  </code></pre>
  <p>I don't know if I'm doing something wrong in the HTML structure or if it's a React Testing Library error.</p>