Driver info: driver.version: unknown at org.openqa.selenium.support.ui.Select.(Select.java:46) at com.myfirst.Main5.main(Main5.java:24)

The element with id Gender is under a div tag. There is no select tag present. Select class is applicable only to elements with tagname – select.
In order to perform your task, you can do:

d.findElement(By.xpath("//*[@id='Gender']/div[1]/div[2]")).click();
d.findElement(
    By.xpath("//div[@class="goog-menuitem-content"][.='Male']"))
        .click();

Leave a Comment