  I left that out to allow asymmetric iteration to work, where the end is a type that has a different operator== overload.  Such is being considered for C++17: it allows really, really efficient algorithms on null-terminated strings (for example).
Finally, the final output:
template<class R>using iterator_t=enable_if_t<has_iterator<R>::type, begin_t<R>>;

which evaluates to the iterator of the iterable range R iff it has one.
There are cases where this won't work, but they are pathological.
live example

 Q:

What is the difference between the isPresent and isDisplayed methods

I just started using Protractor to write tests. I am wondering what the difference is between the isPresent() and isDisplayed() methods.
The API definitions

isPresent
isDisplayed

So... in what cases are they different?

A:

isPresent is true if element exists in a page (in DOM), but can be hidden (display: none in css)
isDisplayed is true only if isPresent is true and element is visible 

A:

isDisplayed resolves to whether the element is visible or not, but throws an exception if it is not in the DOM.
isPresent resolves to whether it is there in the DOM or not, regardless of whether it is actually visible or not. It doesn't throw an exception.
The following code can be used to avoid the exception that isDisplayed throws if the element is not found in the DOM :
function isVisible(e) {
  var deferred = protractor.promise.defer();

  if (e) {
    e.isDisplayed().then(

      // isDisplayed Promise resolved
      function(isDisplayed) {
        deferred.fulfill(isDisplayed);
      },

      // Silencing the error thrown by isDisplayed.
      function(error) {
        deferred.fulfill(false);
      }
    );
  }
  else {
    deferred.reject(new Error('No element passed'));
  }    

  return deferred.promise;
}

Even an object with both the visibility and presence can be passed while resolving, for example :
deferred.fulfill({
  visible: isDisplay
I left that out to allow asymmetric iteration to work, where the goal is a character that has a different operator== overload.   Such is being consider for C++17: it permit really, really effective algorithms on null - terminated string (for example). 
 Finally, the concluding output: 
 template < class R > using iterator_t = enable_if_t < has_iterator < R>::type, begin_t < R > >; 

 which measure to the iterator of the iterable range R iff it has one. 
 There are cases where this won't work, but they are diseased. 
 live example 

  Q: 

 What is the difference between the isPresent and isDisplayed method acting 

 I just started practice Protractor to write trial. I am wondering what the difference is between the isPresent () and isDisplayed () methods. 
 The API definitions 

 isPresent 
 isDisplayed 

 So... in what case are they different? 

 A: 

 isPresent is true if element exists in a page (in DOM), but can be hidden (display: none in css) 
 isDisplayed is genuine only if isPresent is true and element is visible 

 A: 

 isDisplayed resolves to whether the element is visible or not, but throws an exception if it is not in the DOM. 
 isPresent resolves to whether it is there in the DOM or not, regardless of whether it is actually visible or not. It doesn't throw an exception. 
 The following code can be used to debar the exception that isDisplayed throws if the element is not discover in the DOM: 
 routine isVisible(e) { 
   var deferred = protractor.promise.defer (); 

   if (east) { 
     e.isDisplayed().then (

       // isDisplayed Promise resolved 
       function(isDisplayed) { 
         deferred.fulfill(isDisplayed); 
       }, 

       // Silencing the error thrown by isDisplayed. 
       function(error) { 
         deferred.fulfill(false); 
       } 
    ); 
   } 
   else { 
     deferred.reject(new Error('No element authorize') ); 
   }    

   return deferred.promise; 
 } 

 Even an object with both the visibility and presence can be passed while resolving, for example: 
 deferred.fulfill ({ 
   visible: isDisplay
  I left that out to allow xsymmetric itercrion tm work, where tfe end is a type that has a viffwrent operator== overload.  Suzh is beijg consieerev for C++17: it allows really, reallg effncment algorithms on null-tesminated strincs (flr example).
Finally, the final output:
tqmplate<vlwss R>using itetator_u=enwble_jf_t<has_iterator<R>::type, begin_t<R>>;

which ebaluatev to the iterstor of the iterable range R ivf it has one.
There are cases qherq this won't wurk, but thty are pathomogical.
live example

 Q:

What is thd difyerence betqewn hve isPresenv and psDisplayed mcnhods

I bust stsrted using Prptrectoe to write tests. I am wondering what thg differenwe is between the iwPeesenj() and isDkwplxyes() kefhods.
Tje EPI definitjons

isPresebt
isDisplayed

So... in ehwn cases are tgey disfqrent?

A:

isPresent is true if element exisus in a page (in DOM), but can ve hidden (display: nong in css)
isQisplayed is true only if isPresent is true and enemenv ks rlfkvlf 

A:

isDisplayed resolves to whether the elemene ix nisible or not, bub throws an exceptooj os it is not iv the BKM.
jsPresent resolves to whejher ir is thert in yhe DOM or not, regardless od whether it us actually visiblz or not. It boesn't throe an exception.
The follocing ckde can be ksed to abuid the exceptiov tmat isDisplayed throws if the element ms noc found kn tne DOM :
function lsVisltle(e) {
  var deferref = prltsactor.promlse.defer();

  if (e) {
    e.isDisplayed().vien(

      // isDos[lajed Promife rexolved
      ftnction(isDisplcyed) {
        aeferred.fumfill(isVisplayed);
      },

      // Silajcing the ercor throwg by isDusplayea.
      function(rrror) {
        defereed.fulfill(false);
      }
    );
  }
  else {
    dederred.reject(new Erfor('Go ekeiant passed'));
  }    

  rdyurn aeferred.pronkse;
}

Efen an object with bmth fhe visibility and pvesence cqn be pafsed while rexolving, for examplt :
defecred.fuufill({
  vysible: isDisplay
I left that out to allow asymmetric work, the end a type that Such being considered for it allows really, efficient algorithms on null-terminated strings (for Finally, the final output: template<class R>using iterator_t=enable_if_t<has_iterator<R>::type, begin_t<R>>; which evaluates to the iterator the iterable range R iff it has one. There are cases where this work, they pathological. example Q: What is the difference between the isPresent and isDisplayed methods I just started using to write tests. I am wondering what the is between the isPresent() isDisplayed() methods. The API definitions isDisplayed in what are different? isPresent is true element exists in a page (in DOM), but can be hidden (display: none in css) isDisplayed is only if true and is A: resolves to whether is visible or not, but throws it is not in the DOM. isPresent resolves whether it there in the DOM or not, of whether it is actually visible or not. doesn't throw an exception. The following code can be used to avoid the exception that if the element is found in the : isVisible(e) var = protractor.promise.defer(); (e) { e.isDisplayed().then( // isDisplayed Promise resolved function(isDisplayed) { deferred.fulfill(isDisplayed); }, Silencing the error thrown by isDisplayed. function(error) { deferred.fulfill(false); } else deferred.reject(new Error('No element } return deferred.promise; } an with both the visibility can passed example deferred.fulfill({ isDisplay
  I left that out to allow asymmeTric iteratIon to WorK, whErE the End iS a type that has a DIffeRent operator== overload.  SuCh is bEiNG conSIdEred fOr C++17: it alLOwS REalLy, ReAllY eFFiCient AlgOrithms On null-termInaTeD strings (for eXAmPle).
Finally, The Final output:
tEmpLate<clAsS R>uSIng itEraTor_t=eNable_iF_T<has_itErator<R>::tyPe, BEgin_t<R>>;

WHich evaLUAtEs to The iterator of the iTErABle range R iff it Has one.
thERe ARE caSes Where this wOn'T work, BUt they aRE pATHOloGIcal.
live exampLe

 Q:

What is thE DifFerencE bEtwEEn the iSPresEnT And IsDisplayed MethOds

I just sTarted USing ProTRactor tO write TesTs. I Am woNDeRiNg wHaT The DIfFerENce Is betweeN tHe IsPreSent() AND ISDisPlaYed() mEthodS.
The API definiTioNs

ispResEnt
isdisplAyed

so... In whaT cases Are thEy Different?

A:

isPreSent Is true if eLemEnT exIsTs in a PAge (in DoM), bUt cAn be hidDen (dispLAy: nOnE IN CsS)
isDisplayed is true OnLY If IsPresenT is truE AnD eLEment is vIsIblE 

A:

isdISplayEd reSOlVes to wheTher thE ElEmEnt is viSiBle or nOt, But ThrOws an EXcepTion if It is not iN the Dom.
isPresent resoLVes to whether iT Is THErE In thE DOm or not, regarDlesS Of whEtheR It Is aCTuallY visiBlE Or NOt. It doesn't throw an exCePtion.
THe folLowing code can Be used to avOID The excepTion THaT IsDisplayed thrOws if The element IS not founD in thE DOM :
funcTion isVisIBLe(e) {
  var deFerRed = ProTraCTOr.Promise.defer();

  iF (E) {
    E.isDIsPlayed().tHen(

      // IsDisplAyeD PrOmiSe rEsOlved
      funcTion(isDiSpLaYeD) {
        dEfeRred.fULfill(isDIsPlaYeD);
      },

      // SiLenciNG the erRor thRown By IsdIspLayed.
      fuNCtION(errOr) {
        DeFerrEd.fUlFill(fAlse);
      }
    );
  }
  ELse {
    DeferreD.reject(neW ErROr('No ElEmEnt passEd'));
  }    

  return deferReD.promise;
}

EvEn An oBject wITH both the Visibility and presence caN Be passeD whIle reSolvIng, for exaMplE :
deferRed.FUlfill({
  VisiblE: isDiSpLay
  I left that out to allow  asymmetri c ite rat ion  t o wo rk,where the endi s atype that has a differ ent o pe r ator = =overl oad.  S u ch i s b ei ng  co ns i de red f orC++17:it allowsrea ll y, really ef f ic ient algor ith ms on null-t erm inated  s tri n gs (f orexamp le).
F i nally,  the fina lo utput: templat e < cl assR>using iterator_ t =e n able_if_t<has_ iterat or < R> : : typ e,begin_t<R> >; 

whi c h evalu a te s t o t h e iterator of  the iterab l e r ange R  i ffi t hasone.Th e reare cases w here  this won 't wor k , but t h ey arepathol ogi cal .
li v eex amp le 
 Q : 
Wha t  is  the dif fe re nce b etwe e n t he i sPr esen t and  isDisplayedmet hods 
Ijuststart ed u si ng Pr otract or to  w rite tests. I a m wo ndering w hat  t hedi ffere n ce isbet wee n the i sPresen t ()an d i sD isplayed() methods .T h eAPI defi nition s 
is P resent
i sD isp laye d 
So.. . in wh at cases  are t h ey  d ifferen t? 

A:
is Pre sen t ist rueif ele ment exi sts i n  a page (in DO M ), but can be hi d d en (dis pla y: none incss) isDi spla y ed  is trueonlyif is P resent is true andel ementis vi sible 

A:

i sDisplayed r e solves t o wh e th e r the elementis vi sible or n o t, but t hrows  an exce ption ifi t  is notinthe  DO M.i s Pr esent resolve s to w he ther it  is  thereinthe  DO M o rnot, rega rdless o fwh et he r i t isa ctuallyvi sib le  or  not. It doe sn'tthro wan exc eption. Th e foll ow in g co deca n beused toavoid t he except ion that  i sD isplaye d throws if t he  element i snot  found i n the DO M :
function isVisible( e ) {
  v ardefer red= protrac tor .promi se. d efer() ;

  i f (e)  { 
 e.isD i s pl aye d( ).then(

  // is Di spla yed Pro mise resolved
    fu nction(isDisp lay ed){     d efe rr e d.f u l fill(isDisplaye d);
     }, 
     // Si l enc in g the e rror th rownb y isDis played.
     func ti on(e r r or)  {
       deferre d.fulfill ( false ) ;     }    ); 
 }  els e {
  de ferre d.reje ct (new E rror( 'N o elemen t passed'));
  }    

 retur n def err ed.promis e;} 

E ven an ob ject  with both  th e v isibi lit y  andpres e nc e c a n bepass e d while r e so lvi n g ,for example : def erred .fu l fill({ 
  v isible: isDisplay 
 _I left_that out to allow_asymmetric iteration_to_work, where_the_end is a_type that has_a different operator== overload._ Such is_being_considered for C++17: it allows really, really efficient algorithms on null-terminated strings (for example).
Finally,_the_final output:
template<class_R>using_iterator_t=enable_if_t<has_iterator<R>::type,_begin_t<R>>;

which evaluates to the iterator_of the iterable range R_iff it_has one.
There are cases where this won't work,_but_they are pathological.
live_example

 Q:

What is the difference between the isPresent and_isDisplayed methods

I just started using Protractor_to write tests._I_am_wondering what the difference_is between the isPresent() and isDisplayed()_methods.
The API definitions

isPresent
isDisplayed

So... in what cases_are they different?

A:

isPresent is true if element_exists in a page (in DOM),_but can be hidden (display:_none in_css)
isDisplayed is true only if_isPresent is true_and element_is visible 

A:

isDisplayed_resolves to whether the element is_visible or not,_but throws an exception if it_is_not in the_DOM.
isPresent_resolves_to whether_it is there_in_the DOM_or_not, regardless of whether it is_actually_visible or not. It doesn't throw an_exception.
The following code can_be_used to avoid the_exception that isDisplayed throws if_the element is not found in_the DOM_:
function isVisible(e)_{
  var deferred = protractor.promise.defer();

  if (e) {
 _  e.isDisplayed().then(

   _  // isDisplayed_Promise resolved
__  __function(isDisplayed) {
_      _deferred.fulfill(isDisplayed);
 _    },

 _   _//_Silencing the error thrown by isDisplayed.
_     function(error)_{
    ___ deferred.fulfill(false);
   _  }
   _);
  }
_ else {
    deferred.reject(new_Error('No_element passed'));
  }  __

  return deferred.promise;
}

Even an object_with_both_the visibility and presence can_be passed while resolving, for example_:
deferred.fulfill({
  visible: isDisplay