Please refer to the below screenshot. It shows an SMS message in Android Messages that includes an embedded link.

While the attribute for the associated android.widget.TextView class is clickable, manual tests show that clicking on the regular text in the message does not activate the link. Only when directly clicking on the link will the browser open.
In the Appium script, using the click() method on the element does not successfully click on the link (unless the link is centered within the element).
Does anyone have suggestions?
A possible solution that works reliably for me with Appium is to use the TouchAction with tap and specify the coordinates of where the link appears on your phone's screen. Here's some sample code:
TouchAction touchAction = new TouchAction(driver);
touchAction.tap(PointOption.point(x_coordinate, y_coordinate)).perform();
You would define integer variables for the specific x & y coordinates, according to your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With