Here is the HTML code for a JavaScript drop-down menu that contains various options, including "All Resumes". I am attempting to select this option using Selenium WebDriver:
<div id="resume_freshness_container">
<div class="dropdown_small_wrapper">
<div class="left">Last 6 Months</div>
<div class="right"><img class="clip_image" src="http://media.monsterindia.com/v2/recruiter/2.1/new_search/newlook_combined.png"></div>
<div class="clear_both"></div>
</div></div>
<script language="javascript">
jQuery(document).ready(function(){
createSingleSelectCombo({id:'selDay',valueVariableName:'day',tabindex:'62',label:"",preSelected:"180",replaceWithId:'resume_freshness_container',width:'216',heightOptions:'height:240px;overflow-y:auto',animateScroll:true,
options:[{id:'1',values:"in last 1 day"},
{id:'3',values:"in last 3 days"},
{id:'7',values:"in last 7 days"},
{id:'15',values:"in last 15 days"},
{id:'30',values:"in last 1 month"},
{id:'90',values:"in last 3 months"},
{id:'180',values:"in last 6 months"},
{id:'360',values:"in last 12 months"},
{id:'540',values:"in last 18 months"},
{id:'9999',values:"All Resumes"},
{id:'4-7',values:"4-7 days"},
{id:'8-15',values:"8-15 days"},
{id:'16-30',values:"16-30 days"},
{id:'31-90',values:"1-3 months"},
{id:'91-180',values:"3-6 months"},
{id:'181-360',values:"6-12 months"},
{id:'361-540',values:"12-18 months"},
{id:'541-9999',values:"Only older than 18 months"}
]});
borderTopSingleSelect({container:'resume_freshness_container',afterId:'10'});
});
</script>
In my Selenium code, I am attempting to select the desired option from the drop-down menu:
Select select = new Select(driver.findElement(By.id("resume_freshness_container")));
select.deselectAll();
select.selectByVisibleText("All Resumes");
I have also tried selecting it by id "selDay", but I encountered the following exception both times:
Exception in thread "main" org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "div"
*As a beginner in Selenium, I would greatly appreciate any guidance on where I may have gone wrong.*