I have seen this code block fail in another test (test_settings_change_language) where the `li` elements weren't ready. We fixed it there by putting a wait in. I think we should put it in here too just to be on the safe side.