I am trying to click on an element in dropdown, The element is hidden initially when clicking on it, the list is displayed, I want click on one of the names in the list. I tried using the select drop down.. find by visbile text method but getting an error which say the element is type of input and not dropdown.
I tried using xpath,Css selector, linkname and Partiallinktext but none worked.
HTML for the element which i need to click is as below:
<div class="dropdown" style="display: none;">
<div class="search">
<div class="tree" style="display: block;">
<ul class="open">
<li>
<a class="parent open" href="#"></a>
<a class="current" data-nodeid="7" data-name="Global" data-nodemetadata="Global,Global" data-fullname="Global" href="#">Global</a>
<ul class="open">
<li>
<li>
a data-nodeid="807" data-name="Akram" data-nodemetadata="Akram,akram" data-fullname="Akram" `href="#">Akram</a>`
</li>
<li>
I want to click on 'Akram' element. Any help will be appreciated.
Is there a way of passing Variable name in Xpath String, like in the above case Instead of clicking on 'Akram' by I want to click on any other text, So Is it possible to add this text to variable and use the variable inside the xpath "//div[@class='dropdown']//a[text()='Akram']"
Thanks in advance.