Import Issue with

Why do I get the below error while trying to use the Selenium WebDriver Select class in my test case:

The import conflicts with a type defined in the same file

Please help**.**


Just a stab in the dark…

Do you have something else called “Select”? Try:

Import Issue with as DropDown

And use it as DropDown wherever you want to use Select.

1 Like

It works now, thnx Russ

I’m having an issue related to this with the constructor being found. Can you help?
Error: ERROR] - Could not find matching constructor for:

Using your example above I specify dropdown
import as DropDown

Here’s the code:

public class VerifyDropdownValues_AlphabeticalOrder {

static WebDriver driver = DriverFactory.getWebDriver()

static WebElement element = null


public static void verifyOptionsInDropdownInAphabeticalOrder(element) {

DropDown ele = new DropDown(element)

List expectedOptions = new ArrayList<>()

List actualOptions = new ArrayList<>()

for (WebElement option : ele.getOptions()) {

System.out.println("Dropdown options are: " + option.getText())





System.out.println("Numbers of options present in the dropdown: " + actualOptions.size())

Assert.assertEquals(expectedOptions.toArray(), actualOptions.toArray())

System.out.println(“Yes Dropdown values are in Alphabetical order”)