<div id="list" class="x-list">
<div id="list-list" class="x-list-list-ct">
<ul>
<li class="x-item" role="option">US Dollar - USD</li>
<li class="x-item x-list-selected x-list-item-over" role="option">Afghan Afghani - AFN</li> //<--this is my 1st selection from 1st dropdown list
<li class="x-item" role="option">Albanian Lek - ALL</li>
<li class="x-item" role="option">Algerian Dinar - DZD</li>
<li class="x-item" role="option">Angolan Kwanza - AOA</li>
<li class="x-item" role="option">Argentine Peso - ARS</li>
</ul>
</div>
</div>
<div id="list" class="x-list">
<div id="list-list" class="x-list-list-ct">
<ul>
<li class="x-item x-list-selected x-list-item-over" role="option">US Dollar - USD</li> //<--this is my default hover selection
<li class="x-item" role="option">Afghan Afghani - AFN</li>
<li class="x-item" role="option">Albanian Lek - ALL</li>
<li class="x-item" role="option">Algerian Dinar - DZD</li>
<li class="x-item" role="option">Angolan Kwanza - AOA</li>
<li class="x-item" role="option">Argentine Peso - ARS</li>
</ul>
</div>
</div>
When a element is selected or hovered the class name changes to 'x-item x-list-selected x-list-item-over'
For the first list I use driver.findElement(By.xpath("//li[text()[contains(.,'Afghan Afghani - AFN')]]")).click();
When I do the same for second list, the element gets selected but the list doesn't close.
driver.findElement(By.xpath("//div[1]/div/ul/li[text()='Afghan Afghani - AFN']")).click();
driver.findElement(By.xpath("//div[2]/div/ul/li[text()='Afghan Afghani - AFN']")).click();
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/KnnxAsOZZDYJ.--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
Bhushan I tried closing by clicking on a static element, but it isn't helping me.
Santosh : Creating the dynamic xpath on div elements isn't helping me, because the number of div elements are dynamic.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/dXbuVtCkP38J.