Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to extract text from li tag which is again appearing under another li tag in selenium webdriver
    text
    copied!<p>Below is the HTML of the customized drop down from which I want to select a sub level hierarchy, I am not able to add code so i have attached image of the HTML</p> <pre><code>![This is the image of the HTML of my code in which there are li tags under one li tag and I want to extract text of all li tags][1] &lt;ul id="selhierarchy" class="mcdropdown_menu" style="position: absolute; top: 604px; left: 486px; display: block; z-index: 999999; visibility: visible; height: 44px;"&gt; &lt;li class="mc_root mc_parent" rel="5" style="margin-left: 0px; margin-top: 0px; width: 297px;"&gt; Key_element1.1 &lt;ul style="display: none; z-index: 999999; top: 27px; left: 0px; visibility: visible; height: 22px;"&gt; &lt;li class="mc_parent mc_endcol" rel="12" style="margin-left: 0px; margin-top: 0px; width: 150px;"&gt; Key_element2.1 &lt;ul style="display: none; z-index: 999999; top: 23px; left: 0px; visibility: visible; height: 22px;"&gt; &lt;li class="mc_endcol" rel="13" style="margin-left: 0px; margin-top: 0px; width: 150px;"&gt;Key3.1&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="mc_root mc_parent mc_endcol" rel="6" style="margin-left: 0px; margin-top: 0px; width: 297px;"&gt; Key_element1.2 &lt;ul style="display: none; z-index: 999999; top: 50px; left: 0px; visibility: visible; height: 22px;"&gt; &lt;li class="mc_parent mc_endcol" rel="14" style="margin-left: 0px; margin-top: 0px; width: 150px;"&gt; Key_element2.1 &lt;ul style="display: none; z-index: 999999; top: 23px; left: 0px; visibility: visible; height: 44px;"&gt; &lt;li class="" rel="15" style="margin-left: 0px; margin-top: 0px; width: 150px;"&gt;Key3.2&lt;/li&gt; &lt;li class="mc_endcol" rel="16" style="margin-left: 0px; margin-top: 0px; width: 150px;"&gt;Key3.1&lt;/li&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload