Handling Combo-Box Drop downs in Selenium

0 votes
<div style="z-index: 9997;position:relative;" class="container widget-container combobox-container single  listS"><select id="channel" name="channel" class="listS hidden combobox-value">

<option value="15" id="t_auto" name="t_auto">Auto</option>

<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="15">Auto</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option></select><div class="widget-wrap combobox-wrap"><input class="combobox-text m" type="text" readonly="true" value="Select options."><a class="combobox-switch" href="javascript:void(0);"></a><div class="combobox-list-wrap"><ul class="combobox-list"><li class="combobox-list   "><label for="channel-option-1235591060" type="single" class="combobox-label single"><input id="channel-option-1235591060" display="Auto" class="combobox-checkbox" type="checkbox" value="15"><span class="icon"></span><span class="text">Auto</span></label></li><li class="combobox-list   "><label for="channel-option-4946777699" type="single" class="combobox-label single"><input id="channel-option-4946777699" display="1" class="combobox-checkbox" type="checkbox" value="1"><span class="icon"></span><span class="text">1</span></label></li><li class="combobox-list   selected"><label for="channel-option-7201393662" type="single" class="combobox-label single"><input id="channel-option-7201393662" display="2" class="combobox-checkbox" type="checkbox" value="2" checked="checked"><span class="icon"></span><span class="text">2</span></label></li><li class="combobox-list   "><label for="channel-option-7633844640" type="single" class="combobox-label single"><input id="channel-option-7633844640" display="3" class="combobox-checkbox" type="checkbox" value="3"><span class="icon"></span><span class="text">3</span></label></li><li class="combobox-list   "><label for="channel-option-6226055493" type="single" class="combobox-label single"><input id="channel-option-6226055493" display="4" class="combobox-checkbox" type="checkbox" value="4"><span class="icon"></span><span class="text">4</span></label></li><li class="combobox-list   "><label for="channel-option-5233681024" type="single" class="combobox-label single"><input id="channel-option-5233681024" display="5" class="combobox-checkbox" type="checkbox" value="5"><span class="icon"></span><span class="text">5</span></label></li><li class="combobox-list   "><label for="channel-option-6820895318" type="single" class="combobox-label single"><input id="channel-option-6820895318" display="6" class="combobox-checkbox" type="checkbox" value="6"><span class="icon"></span><span class="text">6</span></label></li><li class="combobox-list   "><label for="channel-option-2626353988" type="single" class="combobox-label single"><input id="channel-option-2626353988" display="7" class="combobox-checkbox" type="checkbox" value="7">

<span class="icon"></span><span class="text">7</span></label></li><li class="combobox-list   ">

<label for="channel-option-5819632380" type="single" class="combobox-label single"><input id="channel-option-5819632380" display="8" class="combobox-checkbox" type="checkbox" value="8"><span class="icon"></span><span class="text">8</span></label></li>

<li class="combobox-list   "><label for="channel-option-1193905814" type="single" class="combobox-label single">

<input id="channel-option-1193905814" display="9" class="combobox-checkbox" type="checkbox" value="9"><span class="icon"></span><span class="text">9</span>

</label></li>

<li class="combobox-list   ">

<label for="channel-option-361843719" type="single" class="combobox-label single">

<input id="channel-option-361843719" display="10" class="combobox-checkbox" type="checkbox" value="10"><span class="icon">

</span><span class="text">10</span></label></li><li class="combobox-list   ">

<label for="channel-option-7985938618" type="single" class="combobox-label single">

<input id="channel-option-7985938618" display="11" class="combobox-checkbox" type="checkbox" value="11">

<span class="icon"></span><span class="text">11</span></label></li></ul></div></div></div>

==========================================================================================================================================================================================================

This is my Drop down list.. Can anyone know how to handle this drop down simply.. Because I'm not able to locate element through channel Id its Encrypted with an element of "combo_list", That is having seperate elements for each values.. which Im not able to work on it.

If anyone handled this kind of drop downs please let me know

Jan 14, 2019 in Selenium by Santhosh kumar
12,179 views

Is this what you are trying to do? You want to click on auto and select from the drop down list.

It is showing like a drop down list only but its hidden with combo box and Unable to select using element "Channel".

if you know anything please let me know.!

Hello @santhosh, I tried doing this and it works fine:- 

driver.findElement(By.id("channel")).click();
driver.findElement(By.id("channel")).sendKeys("3",Keys.ENTER);

Let me know as this is what you were looking for?

Hi Priyaaj,

This one wont work since I already tried because I am not able to select or click the option using id "channel",

This combo box is only able to click the element
Message: Element <select id="channel" class="listS hidden combobox-value" name="channel"> could not be scrolled into view

This Error is appearing while using this command,
@santhosh, this was working well for me.
Can you send the entire block of html code?

2 answers to this question.

0 votes
@Priyaj I was not ablet to send you attachement with this can you please let me  know your mail Id
answered Jan 14, 2019 by Santhosh
• 190 points
You can copy paste the entire code here if you want so that everyone who can help can see the code.
@Santosh the way the drop down here in the source file that you have sent doesn't seem okay.

You have drop down and check box both. Can you tell me as what are you trying to do?

select from the drop down and also select the same in the check box?
both are same for one drop down only, you cannot select the drop down using Select tag, I can able to click the tag element by absolute path only otherwise I'm not able to click any element of the dropdown
+1 vote
Suggestion: Try to mimic the action with keyboard events within a loop to test all the options.
answered May 28, 2019 by mary

Related Questions In Selenium

+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
8,405 views
0 votes
1 answer

Handling JavaScript Alert window in Selenium WebDriver

You should try using waits for alerts ...READ MORE

answered Apr 10, 2018 in Selenium by ghost
• 1,790 points
2,481 views
0 votes
1 answer

How to choose from a drop-down in Selenium 2?

You can probably use the 'Select' class ...READ MORE

answered Apr 24, 2018 in Selenium by king_kenny
• 3,710 points
1,185 views
0 votes
1 answer

Handling print dialog in Selenium WebDriver

In Selenium WebDriver we are not able ...READ MORE

answered May 11, 2018 in Selenium by Meci Matt
• 9,460 points
8,214 views
0 votes
1 answer

Handling pop up in Chrome using Selenium WebDriver

AutoIt Window Information Tool do not recognize ...READ MORE

answered Jun 11, 2018 in Selenium by Meci Matt
• 9,460 points
2,903 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,887 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,772 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,187 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,263 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP