Will you please tell me how to get boolean true or false while using element.isPresent()
and element.isDispalyed()
in if clause in Protractor.
Asked
Active
Viewed 34 times
0

Penny Liu
- 15,447
- 5
- 79
- 98
-
1It isn't already? Your post has a typo of `isDispalyed` instead of `isDisplayed`; maybe that's it? – Jacob Jun 05 '20 at 15:27
-
Please priovide code sample. It will be easier to answer – Mulli Jun 05 '20 at 15:28
-
2they return a Promise. You need to either `await` on it or use the `.then` function – Always Learning Jun 05 '20 at 15:28
-
Sample program be if(webelement.isDisplayed()) {return "False"} webelement.isDisplayed is not working in if clause – Vadisa Subramanyam Jun 05 '20 at 15:53
-
TL;DR: this won’t ever work, use `.then`. – deceze Jun 05 '20 at 17:41