Not able to select all option in dropdown

Hii I am trying to test whether my dropdown works or not for that I am selecting all options and then checking whether the expected value is equal to the actual. Basically I want to check that my dropdown is not null. But the problem is it works fine when html element type select is used and not when it is span and it uses a class select which I think is a primeface class (select2-container–default .select2-selection–single).

How do I check this.

It looks like you should still be targeting the <select> element, above the one you are looking at in your screenshot: