Skip to content

How do I read the visibility of an element

This example demonstrates how to check for the visibility of an element and store the output in a variable.

In the solution shown below, you will see that the visibility of "Birthday To Age Calculator" icon in HICC application is stored using "storeVisible" command. 

Solution:

# Command Target Value
Store the visibility of "Birthday To Age Calculator" icon
1 storeVisible id=birthdayToAgeCalculator   age_calculator  
Print the result of the storeVisible command. If the element is visible the command will return true else it will return false.
2 echo ${age_calculator}  

Tips, Tricks, Gotchas & Best Practices:  


  • You can reuse the value of the variable using the notation ${<variable name>}.
  • To know more about how to print the value of the variables stored, click here.
  • To understand more about the best practices of initializing a variable, click here.
  • As a best practice, you are encouraged to use the setTimeout command before and after the "storeVisible" command as this will allow the command to check for the element only for the specified time. To understand more about this, click here.

Feedback and Knowledge Base