I have the following select:
<div class="col-xs-12 col-md-6">
<label class="ph_label pointer city">
<span class="l citylbl">City</span>
<select class="cities custom-dropdown" data-validation-error-msg="You must select a city" required="" name="city" disabled="disabled" data-validation="required">
<option value="">City</option>
<option value="Shanghai">Shanghai</option>
<option value="Beijing">Beijing</option>
<ul class="cities custom-dropdown" data-target-selector="select.cities" style="width: 293px;">
</label>
</div>
I'm trying:
mySelect = Select(self.driver.find_element_by_name("city"))
mySelect.select_by_value("Shanghai")
When I see the test run, selenium goes through this element as if everything was OK, but in fact the city was not selected. Am I missing something?
select_by_visible_text()
- IIRC it is faster. Is it possible that city is not found, select raises exception, and you silence it somewhere?select_by_visible_text()
but nothing interact with this element.#import pdb;pdb.set_trace()
beforemySelect =
. BTW according to PEP8, it should bemy_select
:-)