I've been trying to make a selection from a drop down but cannot seem to figure out how.
Here's what I'm trying to get:
<div id="quote-status" class="panel panel-default">
<div class="panel-heading">
<a class="clickable" ng-click="toggleCollapse();">
<i class="glyphicon glyphicon-expand ng-hide" ng-show="collapsed"></i>
<i class="glyphicon glyphicon-collapse-down" ng-hide="collapsed"></i>
<strong>Quote Status</strong>
</a>
</div>
<div class="panel-body collapse in" collapse="collapsed" style="height: auto;">
<div class="row">
<!-- ngIf: quote.quoteLabels && (quote.quoteLabels.length > 0) -->
</div>
<div class="row">
<div class="col-md-3">
<p><b>* Choose a Status:</b></p>
<select class="form-control ng-pristine ng-valid" ng-model="quote.labelId" ng-change="statusSelectChange()" ng-options="i.id as i.labelName group by i.categoryName for i in labelTypes | filter:{ active : '1' } | orderBy:'priority'">
<option value="" class=""></option>
<optgroup label="Potential Customer">
<option value="0">Low Priority</option>
</optgroup>
</select>
</div>
</div>
</div>
I would like to set option 0 as my value. I'm trying to get the value using:
myselect = Select(driver.find_element_by_class_name("form-control"))
myselect.select_by_value("0")
For this given example, it says that the element is an input, not a select object, when it try to use ng-valid or ng-pristine I get:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"class name","selector":"ng-valid"
Not sure what to do at this point. We're using angular.js on top of a php built web app.