Skip to main content
Version: 8.0.2

Form actions

fillField

Method allowing to fill a specific text element on a page. Clears the value before filling the field (if any value was available).

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to fill.
textstring/numberContent to put inside the targeted text element.
optionsobjectFill action options.

options

NameTypeDescription
characterByCharacterbooleanIf true, the field is filled character by character.
pastebooleanIf true, content will be entirely pasted inside the text element.
speednumberFilling speed when characterByCharacter option is enabled.
note

speed option is similar to an interval between each character added. The default value is 10 (ms).

Basic Usage

with full options.

await I.fillField(
"mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100
});

appendField

Method allowing to append text inside a specific text element on a page.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to add content in.
textstring/numberContent to put inside the targeted text element.
optionsobjectAppend field action options.

options

NameTypeDescription
characterByCharacterbooleanIf true, the field is filled character by character.
pastebooleanIf true, content will be entirely pasted inside the text element.
speednumberFilling speed when characterByCharacter option is enabled.
replacebooleanIf true, the existing content inside the text element will be replaced by the textvalue.
note

speed option is similar to an interval between each character added. The default value is 10 (ms).

Basic Usage

await I.appendField("mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100,
replace: false
})

prependField

Method allowing to prepend text inside a specific text element on a page.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to prepend content in.
textstring/numberContent to put inside the targeted text element.
optionsobjectPrepend field action options.

options

NameTypeDescription
characterByCharacterbooleanIf true, the field is filled character by character.
pastebooleanIf true, content will be entirely pasted inside the text element.
speednumberFilling speed when characterByCharacter option is enabled.
replacebooleanIf true, the existing content inside the text element will be replaced by the textvalue.
note

speed option is similar to an interval between each character added. The default value is 10 (ms).

Basic Usage

        await I.prependField("mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100,
replace: false
})

clearField

Method allowing to clear content inside a specific text element on a page.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to clear content in.

Basic Usage

await I.clearField("mySelector");

select

Method allowing to select content inside a specific text element on a page.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to select content in.

Basic Usage

await I.select("mySelector");

selectOption

Method allowing to select option of a dropdown element (there is no need to open the list with values before the action).

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to select content in.
optionstring / number/ string[] / number[] / objectOptions allowing to select the element selected inside the dropdown.

Basic Usage

string

await I.selectOption(
"mySelector",
"option a"
);

number

await I.selectOption(
"mySelector",
1
);

string[]

await I.selectOption(
"mySelector",
["option a"]
);

number[]

await I.selectOption(
"mySelector",
[1]
);

selectOption.option objects

ParameterTypeDescription
labelstring / undefinedInner text inside the targeted option.
valuestring / undefinedValue of the attribute value matching the targeted option.
indexnumber / undefinedIndex number of the targeted option

Basic Usage

 await I.selectOption(
"mySelector",
{

label:`optionText`,
value: `valueOfAttribute`
})
 await I.selectOption(
"mySelector",
[ {

label:`optionText`,
value: `valueOfAttribute`
}
])

deselectOption

Method allowing to deselect option of a dropdown element.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted text element to deselect.
optionstring / number/ string[] / number[] / objectOptions allowing to deselect the element selected inside the dropdown.

Basic Usage

string

await I.deselectOption(
"mySelector",
"option a"
);

number

await I.deselectOption(
"mySelector",
1
);

string[]

await I.deselectOption(
"mySelector",
["option a"]
);

number[]

await I.deselectOption(
"mySelector",
[1]
);

deselectOption.option objects

ParameterTypeDescription
labelstring / undefinedInner text inside the targeted option.
valuestring / undefinedValue of the attribute value matching the targeted option.
indexnumber / undefinedIndex number of the targeted option

Basic Usage

 await I.deselectOption(
"mySelector",
{

label:`optionText`,
})
 await I.deselectOption(
"mySelector",
[ {

label:`optionText`,
}
])

checkOption

Method allowing to check a checkbox element.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted checkbox element to check.

Basic Usage

await I.checkOption("mySelector");

uncheckOption

Method allowing to uncheck a checkbox element.

ParameterTypeDescription
selectorselectorTypeSelector of the the targeted checkbox element to uncheck.

Basic Usage

await I.uncheckOption("mySelector");