checks if element is not visible
* Separate invalid client test from the valid one * Apply same changes from pr #13197 * Deal with stalereferences caused by timing issues looking up objects in the DOM * Unlink before assertion