ui5-uiveri5
ui5-uiveri5 copied to clipboard
Clear sap.ui.mdc.field.FieldInput
Could you please suggest to me how we can clear sap.ui.mdc.field.FieldInput? My realization: var amountField= element(by.control({ controlType: "sap.ui.mdc.field.FieldInput", id: /.+FormContainer::GeneralInformation::FormElement::DataField::amount::Field-inner$/gm, interaction: "focus" })) amountField.clear(); amountField.sendKeys(AMOUNT); Maybe I did something wrong?
You mean this is not working ?. What happens exactly ?
@maximnaidenov the field has not cleared. the new value is added to the field after the old one
Seems .clear() works only on text input: https://www.protractortest.org/#/api?view=webdriver.WebElement.prototype.clear Maybe you can try with backspace, exactly as you do it manually: https://www.protractortest.org/#/api?view=webdriver.WebElement.prototype.sendKeys
@maximnaidenov Thank you!