Reputation: 7008
I prefer using visibilitOfElementLocated
to locate elements over presenceOfElementLocated
.
The reason for this is it does the work of presenceOfElementLocated
as well (Correct me if i'm wrong).
But there were few situations where i could've achieved my goal just by using presenceOfElementLocated
, instead i used visibilityOfElementLocated
.
Question :
(or let me rephrase)
presenceOfElementLocated
?Upvotes: 1
Views: 6459
Reputation: 27496
Well, I would guess that presenceOfElementLocated
will be slighty faster because it's just check elements presence on the page while the visibilityOfElementLocated
has to check the presence and whether is element visible.
But I think it really doesn't matter from the performance perspective (what's the point if you save 0.001 second during this checking?), you better choose appropriate method depending on your use case.
presenceOfElementLocated
when you don't care whether if element visible or not, you just need to know if it's on the pagevisibilityOfElementLocated
when you need to find element which should be also visibleLook at the documentation for more info.
Upvotes: 7