class sap.ui.test.actions.EnterText

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/test/actions/EnterText
Application Component: CA-UI5-TA

The EnterText action is used to simulate a user entering texts to inputs. EnterText will be executed on a control's focus dom ref. Supported controls are (for other controls this action still might work):


Constructor

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.test.actions.EnterText(sId?, mSettings?)
Param Type Default Value Description
sId? string

Optional ID for the new instance; generated automatically if no non-empty ID is given. Note: this can be omitted, no matter whether mSettings are given or not!

mSettings? object

Optional object with initial settings for the new instance


Properties

Name Type Default Value Description
clearTextFirst boolean true

If it is set to false, the current text of the control will be preserved. By default, the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.

Since: 1.38.0.

Visibility: public
keepFocus boolean false Visibility: public
pressEnterKey boolean false Visibility: public
text string

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

Visibility: public

Borrowed Properties

Name Type Default Value Description
idSuffix string

Use this only if the target property or the default of the action does not work for your control. The id suffix of the DOM Element the press action will be executed on. For most of the controls you do not have to specify this, since the Control Adapters will find the correct DOM Element. But some controls have multiple DOM elements that could be target of your Action. Then you should set this property. For a detailed documentation of the suffix see sap.ui.core.Element#$

Since: 1.38.

Visibility: public

Methods Overview

Method Description
executeOn

Sets focus on given control and triggers Multiple keyboard events on it, one event for every character in the text. Logs an error if control has no focusable dom ref or is not visible.

sap.ui.test.actions.EnterText.extend

Creates a new subclass of class sap.ui.test.actions.EnterText with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.test.actions.Action.extend.

getClearTextFirst

Gets current value of property clearTextFirst.

If it is set to false, the current text of the control will be preserved. By default, the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.

Default value is true.

getKeepFocus

Gets current value of property keepFocus.

Default value is false.

sap.ui.test.actions.EnterText.getMetadata

Returns a metadata object for class sap.ui.test.actions.EnterText.

getPressEnterKey

Gets current value of property pressEnterKey.

Default value is false.

getText

Gets current value of property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

setClearTextFirst

Sets a new value for property clearTextFirst.

If it is set to false, the current text of the control will be preserved. By default, the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setKeepFocus

Sets a new value for property keepFocus.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setPressEnterKey

Sets a new value for property pressEnterKey.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setText

Sets a new value for property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

When called with a value of null or undefined, the default value of the property will be restored.

executeOn

Sets focus on given control and triggers Multiple keyboard events on it, one event for every character in the text. Logs an error if control has no focusable dom ref or is not visible.

Param Type DefaultValue Description
oControl sap.ui.core.Control

the control on which the text event should be entered in.

sap.ui.test.actions.EnterText.extend

Creates a new subclass of class sap.ui.test.actions.EnterText with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.test.actions.Action.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getClearTextFirst

Gets current value of property clearTextFirst.

If it is set to false, the current text of the control will be preserved. By default, the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.

Default value is true.

getKeepFocus

Gets current value of property keepFocus.

Default value is false.

sap.ui.test.actions.EnterText.getMetadata

Returns a metadata object for class sap.ui.test.actions.EnterText.

getPressEnterKey

Gets current value of property pressEnterKey.

Default value is false.

getText

Gets current value of property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

setClearTextFirst

Sets a new value for property clearTextFirst.

If it is set to false, the current text of the control will be preserved. By default, the current text of the control will be cleared. When the text is going to be cleared, a delete character event will be fired and then the value of the input is emptied. This will trigger a liveChange event on the input with an empty value.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bClearTextFirst boolean true

New value for property clearTextFirst

setKeepFocus

Sets a new value for property keepFocus.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bKeepFocus boolean false

New value for property keepFocus

setPressEnterKey

Sets a new value for property pressEnterKey.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bPressEnterKey boolean false

New value for property pressEnterKey

setText

Sets a new value for property text.

The Text that is going to be typed to the control. If you are entering an empty string, the value will be cleared.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sText string

New value for property text