In a strict performance comparison the execution speed of Wait Until Element Is Visible
vs Element Should Be Visible
, on element(s) that is already present in the DOM, is virtually the same.
They both do the same thing - find the element in the DOM, and call selenium's is_visible()
method. The difference is the Wait Until
loops and repeats if any of the two steps fail.
Thus for your (or similar) case, when the presence of one element (the header) should guarantee the other 19 are also already loaded, which one to use shouldn't matter.
If you use Wait Until ...
on the header and Element Should Be Visible
on the others, you'll be also testing that assumption in your case. Naturally, if all but the 19th elements are loaded together with the header, the case will fail.
If you use Wait Until ...
on all elements the chance of passing will be higher - if any of the elements is added and visualized slower than the rest, the kw will wait for it. Obviously this situation will lead to slower runtime - because of the waiting on the condition to be fulfilled.
As for the readability aspect of using one vs the other, I won't comment on that. This is a question of implementation and code structure; you can always make something simple look dreadful, or present a complex solution in a beautiful way :). The same as python allowing you to write code like poetry, or ugly mess (the same goes for some SO answers :D); yours truly is guilty of doing all of this :)