TestProject Forum
Powered by leading experts in the test automation community

Clicking checkbox without clicking the text content

Hello, I have 3 checkboxes with some text and a link inside the text. My aim is to check the checkbox. When i do manually through andriod emulator without recording , it is getting clicked successfully . But when I record the action, the link inside the text content is getting clicked. There is only one view component for each checkbox… So i guess testproject recorder is clicking on the entire element area instead of the checkbox alone. how i can tackle this situation. An early response would be appreciated.

Hello @lipson.augustine.

You can try hovering with your mouse around the area of the checkbox and viewing the parent elements if the link is getting recognized to locate the parent checkbox:

image

Another option would be to search for the checkbox in the DOM using the element explorer:
image

Or locating the checkbox directly via writing your own XPATH and creating the tap/click actions manually using the element locator you’ve decided on.

there is no parent elements and the checkbox and the text is a single component. please find the below screenshot for better understanding. My aim is to just check the checkbox without the link getting opened
Screenshot 2020-08-13 at 19.47.03


.

@david.goichman

When i do click through andriod emulator without testproject recording , it is getting clicked successfully . But when I record the action , the checkbox is not getting checked though it is clicking for the first checkbox. For the remaining two, link is getting opened. Why is it so?

@lipson.augustine.

When you’re tapping on it in the emulator, you’re just tapping on screen coordinates.

If both of them are in the same element, for that specific element, the click might be going on the link instead of the checkbox on the far left.
You can try tackling this by getting the location of the element and creating a tap action on coordinates with consideration to the location of the checkbox:

image

image

Thank you so much for the response.