I am automating an iPhone App. The scenario is Login Logout and re-Login. But while re-login the username and password field is displaying the details. I am trying to list that xpath as a WebElement and clear() that field if(Webelement.gettext() !="") But it is not happening as in the existing framework is taking xpath as String and typecast the String to WebElement is not Possible. Is there any other way to achieve that?? Kindly Help me.