how to get the placeholder text from webdriver

862 views
Skip to first unread message

Rashmi Upari

unread,
Feb 10, 2019, 8:29:24 AM2/10/19
to Selenium Users
Hi all,

Attached is the screenshot of text DOB, i want to get the placeholder text so that i can know the format and then add data based on the format.

xpath : //*[@id=\"txt-birthday\"]
cssselector : #txt-birthday

Thanks
Screenshot 2019-02-10 at 6.53.52 PM.png

Oleksiy Kyrylenko

unread,
Feb 10, 2019, 8:36:08 AM2/10/19
to seleniu...@googlegroups.com
You need to use GetAttribute method. The naming of this method various between different bindings. The pseudo code would be string text = element.GetAttributeValue("placeholder");

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8d363ba7-d4bb-4ee1-b58b-19c99118f6f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rashmi Upari

unread,
Feb 11, 2019, 1:21:45 AM2/11/19
to Selenium Users
Thanks, now i m getting the placeholder text :)
Reply all
Reply to author
Forward
0 new messages