Flexibility to pass either WebElement or By objects for automation