Hi Ashish,
Please confirm if the mentioned code is ok or not. I am not getting any failure. Your code was different so i just wanted to confirm.
public boolean ValidateDropDown(String locatorkey,String portfolio_name) {
WebElement element = getElement(locatorkey);
select = new Select(element);
List<WebElement> list_drop_down = select.getOptions();
for(int i=0; i<list_drop_down.size();i++) {
//System.out.println(list_drop_down.get(i).getText());
if(list_drop_down.get(i).getText().equals(portfolio_name)){
return true;
}
}
return false;
Instructor
Ashish Thakur Replied on 01/06/2021
yes
Looks good