angularjs - Getting the error "Failed: Element is not currently visible and so may not be interacted with" -
while trying click element as:
element.all(by.repeater("condition in filterctrl.conditions")).get(1).click();
i getting error as:
failed: element not visible , may not interacted with".
how can overcome this.
my css below
<div class="_md-select-menu-container _md-active _md-clickable" aria-hidden="false" id="select_container_198" style="display: block; left: 764px; top: 181px; min-width: 234.547px;"><md-select-menu class="ng-scope _md-overflow" style="transform-origin: 101.273px 72px 0px;"><md-content> <!-- ngrepeat: condition in filterctrl.conditions --><md-option ng-repeat="condition in filterctrl.conditions" value="contains" tabindex="0" class="ng-scope md-ink-ripple" aria-selected="false" role="option" id="select_option_257"><div class="_md-text ng-binding">contains</div></md-option><!-- end ngrepeat: condition in filterctrl.conditions -->option ng-repeat="condition in filterctrl.conditions" value="ends_with" tabindex="0" class="ng-scope md-ink-ripple" role="option" aria-selected="false" id="select_option_261"><div class="_md-text ng-binding">ends with</div></md-option><!-- end ngrepeat: condition in filterctrl.conditions --> </md-content></md-select-menu></div>"
well error telling element isn't visible, that's why can't perform click. not sure how app setup, if it's angular or not etc. suggest trying 2 things:
1) if element loaded, try scroll view.
var scrollintoview = function () { arguments[0].scrollintoview(); } browser.executescript(scrollintoview, yourwebelement);
or
2) make sure element present , displayed on page. if change code expect
statement , add.ispresent()
or .isdisplayed()
- return true? based on error guess ispresent()
returns true, isdisplayed()
returns false. if that's case try adding implicit wait function wait element load before trying click on it.
Comments
Post a Comment