I am new to selenium , currently am working on selenium webdriver i want to select a value from the drop down. but i am not able to do because of some error. Also want to inform you that in my automator viewer i have not find any id of the dropdown element hence i am using with xpath but i am not able to do please guide me. My java code is below:


public void print() throws Exception


    WebDriverWait wait = new WebDriverWait(driver, 60);// 1 minute


    Select drpCountry = new Select(driver.findElement(By.xpath("//android.widget.ImageView[@index='2']")));



enter image description here


It seems that your Select element is one level above the thing you are capturing, try using xpath of the View above your ImageView

  • Hi @Moro , I have try as you said but got no any solution :( – Rahul Kumar Dec 2 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.