---
title: "Comment by ankur dhull on \"How to test a select element with React Testing Library\" | Hashnode"
description: "screen.getByRole(&#39;option&#39;, { name: &#39;Ireland&#39; }), for this getting error as multiple elements found out with role options. Throwing error at getB"
url: "https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/628d04f8bc26026fa45c46fd"
---

[Discussion](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6)

Comment [How to test a select element with React Testing Library](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6)

[ankur dhull](https://hashnode.com/@dhull123)

[May 24, 2022](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/628d04f8bc26026fa45c46fd)

screen.getByRole('option', { name: 'Ireland' }), for this getting error as multiple elements found out with role options. Throwing error at getByRole not going to the name condition

[Cathal Mac Donnacha](https://hashnode.com/@cathalmacdonnacha)

[May 25, 2022](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/628d04f8bc26026fa45c46fd#reply-628dfd3419bda58ac7fb0855)

Hey [ankur dhull](https://hashnode.com/@dhull123)

Thanks for reading.

When it comes to select element options, I wouldn't expect there to be any duplicates (e.g options with the same name). If you put a live example up on codesandbox or somewhere similar I can take a look.

Cheers, Cathal.
