String[] arr = {"Month","Jan","Feb","Mar", "Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
WebElement dropDown = getDriver().findElement(By.id("month"));
Select select = new Select(dropDown);
List<WebElement> options = select.getOptions();
for(WebElement we : options){
for(int i = 1; i<arr.length; i++){
if(we.getText().equals(arr[i])){
System.out.println("Matched" );
break;
}
}
}
I want to find duplicate months on a Facebook dropdown by using Selenium in Java.
I tried findelement, web element but I could not do that. Right now; I can match the months with the webpage. Original question is like this: find if month dropdown contains any duplicates. If yes then print out those values which are duplicate. Thnx