3

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

SMS message with 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?

mc-sm9
  • 149
  • 1
  • 7

1 Answers1

3

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.

toasty
  • 228
  • 2
  • 7
  • Thanks! This is a good workaround. However, since it is not always possible to know where the link displays on the screen, it would be great to find a more durable solution that is extensible to other scenarios and future tests. – mc-sm9 Sep 13 '18 at 00:05