How to identify text control by placeholder attribute
Posted: Wed Mar 20, 2013 12:27 pm
Hi,
I would like to identify a textbox (UITextField in iOS) by its "placeholder" attribute (the greyed out text visible before you enter anything).
I tried setting the XPath to /form/container/text[@placeholder='username'] for example, but it does not find the element.
Also, I could not seem to validate this property either (using an Xpath that works, like text[1]):
Validate.Attribute(repo.DemoRX.SomeContainer.UsernameInfo, "placeholder", "username");
Attribute 'placeholder' of element for item 'DemoRXRepository.DemoRX.SomeContainer.Username' does not match the specified value (actual='(null)', expected='username').
Is there any way of accessing the "placeholder" property? From code?
I would like to identify a textbox (UITextField in iOS) by its "placeholder" attribute (the greyed out text visible before you enter anything).
I tried setting the XPath to /form/container/text[@placeholder='username'] for example, but it does not find the element.
Also, I could not seem to validate this property either (using an Xpath that works, like text[1]):
Validate.Attribute(repo.DemoRX.SomeContainer.UsernameInfo, "placeholder", "username");
Attribute 'placeholder' of element for item 'DemoRXRepository.DemoRX.SomeContainer.Username' does not match the specified value (actual='(null)', expected='username').
Is there any way of accessing the "placeholder" property? From code?