Refactor to use By.attribute instead of By.ByAttribute