Article Overview:
This article will cover how you can achieve the following:
How to handle interactions with elements such as clicking, selecting, or writing using the SetValue extension when these actions fail during cross-browser testing.
Problem Statement:
Virtuoso's cross-browser testing struggles with web element interaction on Apple devices using Safari 13 or higher, Due to this, compatibility checks are complicated.
Solution:
1: Using the SetValue Extension
1. Add the following extension into the Extension section in Virtuoso: SetValue
2. Use the following steps to Click/Select/Write.
Store element details of "Required Element" in $textInput
setValue($textInput, $replaceWithData)
Note: The set value step will operate analogous to Write/Select/Click
Example:
The following highlighted area requires the selection of the effective date, but elements cannot be clicked, selected, or filled while automating from Virtuoso.
Step 1: Store the element details of a particular element in a variable.
Step 2: Use the SetValue extension instead of write/click/select (based on requirement).
Inputs for Extension:
- Stored Element Details in Variable: In this example, $effeDate contains element details.
- Data to be written in the Text Area: In this example, the data is sourced from the data table variable $EffectiveDate (which contains the date 03/10/2024).
Note: Alternatively, the data can be hardcoded.
The screenshot above shows that the SetValue extension effectively picked the day from the calendar.
2: Using Safari 12 for execution
Run the test on Safari 12 instead.
Following the above-outlined steps, we can effectively interact with elements in cross-browser testing when failing to perform actions like click, select and write.
Comments
0 comments
Please sign in to leave a comment.