In some cases however, it is possible to rely on a class’ private implementation details. (Of course, such private details may vary across Java versions, so are not ideal.) In the case of the FormText class, there is a private member called model which itself has a member variable called accessibletext, and this contains the displayed text.
However, because the model member is a private member, Squish cannot access it directly. Fortunately, this can be worked around by using Java’s reflection API.
Here is an example that demonstrates how to do it:
We would like to use Google Analytics to get a better understanding of how
you use the website.
By agreeing to this, your usage data will be stored in the USA and processed
by Google LLC. Both Google as well as federal US agencies can access this data
and combine it with any other data about you, such as your search history,
personal accounts or any other data known to Google.