3
var spinner = element(by.css('.glyphicon.glyphicon-ok.green:not(.ng-hide)'));
expect(spinner.isDisplayed()).toBeTruthy();
spinner.click();

when I execute this always receiving an error as

ElementNotVisibleError: element not visible

I want to select this element

<span class="glyphicon glyphicon-ok green" data-ng-show="Choice.IsCorrect"/>

and not to select other element as

<span class="glyphicon glyphicon-ok green ng-hide" data-ng-show="Choice.IsCorrect"/>
nilsK
  • 4,323
  • 2
  • 26
  • 40
Sneha Shejwal
  • 311
  • 3
  • 6

1 Answers1

2

The correct way of doing it as below

var popUp = ($('[data-ng-show="Choice.IsCorrect"].glyphicon.glyphicon-ok.green:not(.ng-hide)'));
popUp.click();

so this will always return the visible element and can click on it.

Thank you everyone for looking into it.

Sneha Shejwal
  • 311
  • 3
  • 6