ui5-uiveri5 icon indicating copy to clipboard operation
ui5-uiveri5 copied to clipboard

Clear sap.ui.mdc.field.FieldInput

Open volha-zasimovich opened this issue 4 years ago • 4 comments

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?

volha-zasimovich avatar Oct 27 '20 13:10 volha-zasimovich

You mean this is not working ?. What happens exactly ?

maximnaidenov avatar Oct 27 '20 13:10 maximnaidenov

@maximnaidenov the field has not cleared. the new value is added to the field after the old one

volha-zasimovich avatar Oct 27 '20 13:10 volha-zasimovich

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 avatar Oct 27 '20 14:10 maximnaidenov

@maximnaidenov Thank you!

volha-zasimovich avatar Oct 27 '20 21:10 volha-zasimovich