Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check that the options in dropdown are displayed twice in Selenium Webdriver using Java
    primarykey
    data
    text
    <p>I am stuck in one logic, where I have to verify if the options in dropdown are displaying twice. I searched in google for the solution, but didnt find any.</p> <p>I have this code to get all the options from the dropdown. But not really sure how should I check if the options are displayed twice.</p> <pre class="lang-java prettyprint-override"><code>new Select(driver.findElement(By.xpath(//*[@id='unmappedTech']))).selectByVisibleText(VisibleText); new Select(driver.findElement(By.xpath(//*[@id='unmappedTech']))).getOptions(); </code></pre> <p>In my application, options are displaying twice in dropdown. Here is the source code of dropdown:</p> <pre class="lang-html prettyprint-override"><code>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;select name="unmappedTech" id="unmappedTech" multiple="multiple" size="10" style="width: 160px;"&gt; &lt;option class=" firepath-matching-node" value="142"&gt;Cloud Service Assurance&lt;/option&gt; &lt;option value="123"&gt;Cloud Service Assurance Zenoss for Data Center and Cloud&lt;/option&gt; &lt;option value="6"&gt;CUSTOMER COLLABORATION&lt;/option&gt; &lt;option value="12"&gt;DESKTOP VIRTUALIZATION&lt;/option&gt; &lt;option value="13"&gt;FACILITIES&lt;/option&gt; &lt;option value="7"&gt;INSTANT MESSAGING&lt;/option&gt; &lt;option value="8"&gt;MOBILE COLLABORATION&lt;/option&gt; &lt;option value="141"&gt;Network Address Translation&lt;/option&gt; &lt;option value="15"&gt;NETWORKING&lt;/option&gt; &lt;option value="3"&gt;SECURITY&lt;/option&gt; &lt;option value="16"&gt;STORAGE&lt;/option&gt; &lt;option value="81"&gt;TestTechnology_Dont_Delete&lt;/option&gt; &lt;option value="10"&gt;UNIFIED COMMUNICATIONS&lt;/option&gt; &lt;option value="20"&gt;VCH VIDEO&lt;/option&gt; &lt;option value="17"&gt;VIRTUALIZATION And CONSOLIDATION&lt;/option&gt; &lt;option value="21"&gt;VtechnologyVtechnologyVtechnologyVtechnology&lt;/option&gt; &lt;option value="2"&gt;WIRELESS&lt;/option&gt; &lt;option class=" firepath-matching-node" value="142"&gt;Cloud Service Assurance&lt;/option&gt; &lt;option value="123"&gt;Cloud Service Assurance Zenoss for Data Center and Cloud&lt;/option&gt; &lt;option value="6"&gt;CUSTOMER COLLABORATION&lt;/option&gt; &lt;option value="12"&gt;DESKTOP VIRTUALIZATION&lt;/option&gt; &lt;option value="13"&gt;FACILITIES&lt;/option&gt; &lt;option value="7"&gt;INSTANT MESSAGING&lt;/option&gt; &lt;option value="8"&gt;MOBILE COLLABORATION&lt;/option&gt; &lt;option value="141"&gt;Network Address Translation&lt;/option&gt; &lt;option value="15"&gt;NETWORKING&lt;/option&gt; &lt;option value="3"&gt;SECURITY&lt;/option&gt; &lt;option value="16"&gt;STORAGE&lt;/option&gt; &lt;option value="81"&gt;TestTechnology_Dont_Delete&lt;/option&gt; &lt;option value="10"&gt;UNIFIED COMMUNICATIONS&lt;/option&gt; &lt;option value="20"&gt;VCH VIDEO&lt;/option&gt; &lt;option value="17"&gt;VIRTUALIZATION And CONSOLIDATION&lt;/option&gt; &lt;option value="21"&gt;VtechnologyVtechnologyVtechnologyVtechnology&lt;/option&gt; &lt;option value="2"&gt;WIRELESS&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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