I have this chunk of code:
void setFilterAndClickApply(String type,String... items){
LOG.i("Clicking on filter menu inside comboboxcommon with type="+type + " and items= " + Arrays.toString(items));
selectUlMenu(type, items);
sleep(Duration.FIVE_HUNDRED_MILLISECONDS);
clickApply();
if(waitElmBecomeInvisible(Duration.TWO_SECONDS, applyBthBy)){
TESTS_LOG.info("Menu was closed as expected");
}else {
TESTS_LOG.info("Filter clicked successfully");
}
}
where I am validating if the element is visible (using 'waitElmBecomeInvisible') if the element is not visible I am returning a message which indicates this. if the element is visible I want to throw exception I am not sure which exception I should throw and this is the point where you guys can suggest me kindly what do you think I should implement as an exception