forked from facebookarchive/WebDriverAgent
-
Notifications
You must be signed in to change notification settings - Fork 450
Open
Description
Description
I'm trying to implement a text append functionality for text fields in my automation tests, but I've noticed that the current implementation in XCUIElement+FBWebDriverAttributes.m prevents this from working correctly.
In the wdValue method, when handling text fields, the code sets the placeholder value as a fallback when the actual value is empty:
else if (elementType == XCUIElementTypeTextView ||
elementType == XCUIElementTypeTextField ||
elementType == XCUIElementTypeSecureTextField) {
NSString *placeholderValue = self.placeholderValue;
value = FBFirstNonEmptyValue(value, placeholderValue);
}This causes an issue where I can never properly append text to a field that has a placeholder, as the WebDriverAgent returns the placeholder text instead of an empty string when the field is empty.
Question
- Why was the decision made to return the placeholder value as the element's value? I understand this might be useful for element location/identification, but it breaks the ability to append text.
- Is there another way to implement text append functionality while maintaining this behavior?
- Would it be possible to add an additional attribute that returns the raw value without the placeholder fallback?
Reference
Metadata
Metadata
Assignees
Labels
No labels