Modifications to findElement et al. for test_visibility.py