How to locate a dropdown from div?



Below is some html code.



<div id="ServiceTypeId_chzn" class="chzn-container chzn-container-single" style="width: 389px;">
<a class="chzn-single" tabindex="-1" href="javascript:void(0)">
<span>Choose an Option</span>
<div>
<b></b>
</div>


Upon clicking the dropdown the list pops up.


i am trying to click and select the value


I'm trying to locate an element with the C# code below:



driver.FindElement(By.XPath("//div[@Id='ServiceTypeId_chzn']")).Click();


But I'm unable to locate it.


No comments:

Post a Comment