I'm starting automation with Selenium, it's the very first time im doing it alone and i can´t find the correct code for a dropdown list here https://demoqa.com/automation-practice-form at the end there is a "State and City list".. for state you have to click on "Select State" then it gives you the options so then you have to click on the option wanted.
This is my code, I've tried different options but this is the closest one to get a correct working of the code (but it's still not doing what it needs to be done) I know it cant be done with a Select since it's a div and I can only use:
driver.findElement()
Code trials:
//Select state and city
driver.findElement(By.id("state")).click();
driver.findElement(By.xpath("//body/div/div/div/div/div/div/form/div[10]/div[2]/div[1]/div[1]/div[1]/div[1]")).click();
Image A: enter image description here
Image B:
Image C: enter image description here