You can get placeholder text using the method getAttributefor webdriver.
HTML:
<input id="<ur id>" class="<ur class name>" type="password" lang="en" maxlength="30" placeholder="Enter Password" data-label="passwordPlaceholder" tabindex="5">
Java Code:
String password=driver.findElement(By.cssSelector("ur css path")).getAttribute("placeholder");
Mohan source
share