Hi, I am able to resolve it using following two lines. @browser.span(:text,'').click // Click on list to expand it. @browser.div(:text,'').click //click on element to select it.
I hope this is nice way. Any suggestion from experts? On Mon, Dec 29, 2014 at 3:32 PM, Sohail Mirza <[email protected]> wrote: > *Hi,* > I have following complex HTML code rendered for select list (not drop > down).. developer used Div & span tags to make it look alike drop down with > values populated.... > My requirement is to select value Test 1 (showing in below code). I did > what i can do but not able to select it. > Any suggestion please? > > *HTML Rendered Code:* > > <div class="form-group" ng-class="{ 'has-error' : > TestFrom.TestType.$invalid && (TestFrom.TestType.$touched|| > TestFrom.$submitted) }"> > <label for="TestType" class="control-label">Test > Type</label> > <div> > <div class="select2 select2-container ng-valid > ng-dirty ng-valid-parse select2-container-active select2-dropdown-open" > ng-class="{'select2-container-active select2-dropdown-open': $select.open, > 'select2-container-disabled': $select.disabled, > 'select2-container-active': $select.focus, > 'select2-allowclear': $select.allowClear && > !$select.isEmpty()}" id="TestType" name="TestType" > ng-model="TestType.selected" theme="select2" ng-disabled="disabled" > style="min-width: 200px;"><a class="select2-choice ui-select-match" > ng-class="{'select2-default': $select.isEmpty()}" > ng-click="$select.activate()" placeholder="Select Test Type"><span > ng-show="$select.isEmpty()" class="select2-chosen ng-binding > ng-hide">Select Test Type</span> <span ng-hide="$select.isEmpty()" > class="select2-chosen" ng-transclude=""><span class="ng-binding > ng-scope">Exploration > </span><button id="btnTestTypeClear" > name="btnTestTypeClear" style="background:none;border:none;cursor:pointer; > padding:5px 10px; position:absolute; right:10px; top:-5px;" > ng-click="clear($event)" class="ng-scope">x</button> > </span> > <span class="select2-arrow ui-select-toggle" > ng-click="$select.toggle($event)"><b></b></span></a><div > class="select2-drop select2-with-searchbox select2-drop-active" > ng-class="{'select2-display-none': !$select.open}"><div > class="select2-search" ng-show="$select.searchEnabled"><input type="text" > autocomplete="off" autocorrect="off" autocapitalize="off" > spellcheck="false" class="ui-select-search select2-input ng-pristine > ng-valid ng-touched" ng-model="$select.search"></div><ul > class="ui-select-choices ui-select-choices-content select2-results > ng-scope" repeat="TestType in TestTypes | propsFilter: {Name: > $select.search}"><li class="ui-select-choices-group" > ng-class="{'select2-result-with-children': $select.isGrouped}"><div > ng-show="$select.isGrouped" class="ui-select-choices-group-label > select2-result-label ng-binding ng-hide" ng-bind-html="$group.name"></div><ul > ng-class="{'select2-result-sub': $select.isGrouped, > 'select2-result-single': !$select.isGrouped}" > class="select2-result-single"><!-- ngRepeat: TestType in $select.items > --><!-- ngIf: $select.open --><li class="ui-select-choices-row ng-scope > select2-highlighted" ng-class="{'select2-highlighted': > $select.isActive(this), 'select2-disabled': $select.isDisabled(this)}" > ng-repeat="TestType in $select.items" ng-if="$select.open" > ng-mouseenter="$select.setActiveItem(TestType)" > ng-click="$select.select(TestType,false,$event)"><div > class="select2-result-label ui-select-choices-row-inner" > uis-transclude-append=""> > <div ng-bind-html="TestType.Name | highlight: > $select.search" class="ng-binding ng-scope">*Test 1*</div> > </div></li> > > ---------------- > ------------------ > ----- > > > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
