0

I'm trying to get a select to work for the following div:

<div class="control-group generic-style clearfix">
    <label for="Category">Category</label>
    <div class="controls">
        <select class="jquery-select" id="Category" name="Category" style="display: none;">
            <option selected="selected" value="2000">Coaching</option>
            <option value="2000">Coaching</option>
            <option value="8000">Closed</option>
            <option value="10000">Unavailable</option>
            </select>
        <span id="CategorySelectBoxItContainer" class="selectboxit-container selectboxit-container" role="combobox" aria-haspopup="true" aria-expanded="false" aria-owns="CategorySelectBoxItOptions" aria-labelledby="">
            <span id="CategorySelectBoxIt" class="selectboxit jquery-select selectboxit-enabled selectboxit-btn selectboxit-open-down" name="Category" tabindex="0" unselectable="on">
                <span class="selectboxit-option-icon-container">
                    <i id="CategorySelectBoxItDefaultIcon" class="selectboxit-option-icon  selectboxit-container selectboxit-default-icon" unselectable="on">
                        </i>
                    </span>
                <span id="CategorySelectBoxItText" class="selectboxit-text" unselectable="on" data-val="8000" style="max-width: 190px;" aria-live="polite">Closed
                    </span>
                <span id="CategorySelectBoxItArrowContainer" class="selectboxit-arrow-container" unselectable="on">
                    <i id="CategorySelectBoxItArrow" class="selectboxit-arrow selectboxit-default-arrow" unselectable="on">
                        </i>
                    </span>
                </span>
            <ul id="CategorySelectBoxItOptions" class="selectboxit-options selectboxit-list" tabindex="-1" role="listbox" aria-hidden="true" style="max-height: 281px; top: auto; display: none;">
                <li data-id="0" data-val="1000" data-disabled="false" class="selectboxit-option  selectboxit-option-first" role="option">
                    <a class="selectboxit-option-anchor">
                        <span class="selectboxit-option-icon-container">
                            <i class="selectboxit-option-icon  selectboxit-container">
                                </i>
                            </span>
                        Booking
                        </a>
                    </li>
                <li data-id="1" data-val="2000" data-disabled="false" class="selectboxit-option" role="option">
                    <a class="selectboxit-option-anchor">
                        <span class="selectboxit-option-icon-container">
                            <i class="selectboxit-option-icon  selectboxit-container">
                                </i>
                            </span>
                        Coaching
                        </a>
                    </li>
                <li data-id="2" data-val="8000" data-disabled="false" class="selectboxit-option selectboxit-selected selectboxit-focus" role="option">
                    <a class="selectboxit-option-anchor">
                        <span class="selectboxit-option-icon-container">
                            <i class="selectboxit-option-icon  selectboxit-container">
                                </i>
                            </span>
                        Closed
                        </a>
                    </li>
                <li data-id="3" data-val="10000" data-disabled="false" class="selectboxit-option  selectboxit-option-last" role="option">
                    <a class="selectboxit-option-anchor">
                        <span class="selectboxit-option-icon-container">
                            <i class="selectboxit-option-icon  selectboxit-container"></i>
                            </span>
                        Unavailable
                        </a>
                    </li>
                </ul>
            </span>
        </div>
    </div>

All of the things I've tried end up with an item not select-able error. I've tried several different approaches from items found on the web without making progress. What can I try next?

3
  • also add what are commands, locators are used and do not worked Commented Apr 20 at 3:35
  • You need to edit your question and fix the formatting/indent of the HTML. Something isn't quite right in there somewhere. You also need to add your current code and full error message... both as text, properly formatted. Commented Apr 20 at 4:30
  • The first thing I see in the HTML is that the SELECT element contains style="display: none;" which means it isn't visible. Selenium was designed intentionally to NOT work on invisible elements. You need to figure out how to make the SELECT visible and THEN interact with it. We can't help with that without the URL. Commented Apr 20 at 4:32

1 Answer 1

0

I actually managed to get it to work using (C#)

driver.ExecuteScript("$('#Category').val(10000).change();");

Thanks for the feedback anyhow.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.