INTRODUCTION :

Click/ Tap is one of the most used NLP in our product and it has been observed that many first time users often get an error message while using this NLP initially. So, this article will help you understand the functionality of click/tap NLP while creating a test step inside a test case.

FUNCTIONALITY OF CLICK/TAP :

Generally, when we use click/Tap functionality in Testsigma while clicking or tapping on any element with suitable UI Identifier we make sure of these following things :

1. The element is Enabled

      Our first criteria is to make sure that the element that you are trying to click is enabled. If the element is enabled, then it will check our second criteria mentioned below. In case the element is disabled, it will throw an error message "Element is either hidden or disabled". So, before we click on any element, we need to make sure that it is enabled.


 2. The element is Visible

    Our second criteria is to make sure that the element that you are trying to click is visible/not hidden. In case it is not visible, it will throw the same error message mentioned above.
It is possible that the element that you are trying to click is present below the page. So for that, we are internally using the Scroll functionality to find the element that you want to click.

3. Correct Xpath

    Our third criterion is to ensure the element is being clicked or tapped by providing the correct Xpath. You can use our Chrome Extension for getting the Xpath for UI Identifier or you can write Xpath manually.


TROUBLESHOOTING/DEBUGGING:

In case any user wants to check whether the element is visible or not, they can use Appium Inspector to inspect the element as shown below to check if the 'enabled' and 'visible' attributes are 'true'.


The above image is for elements for which Tap NLP would probably fail since it doesn't satisfy the second condition. 

The above image is for elements for which Click NLP would probably fail since it doesn't satisfy the first condition.

CONCLUSION:

The click/Tap NLP will have a smooth run once these criteria are met. In case you have any problem regarding the Click/Tap NLP please make sure that these criteria are being met and referring to this you can also troubleshoot.