4

I am working in a automation project for android application. Any idea on how to click specific text in a set of words in a textView?

The textView contains "By purchasing such item. Please be aware that there are certain guide or rules we need to read in order for the user to handle the product. The following link are Product Guide. Once you read the product please check out the terms and agreement."

I need to click Product guide and terms and agreement link, but the link has no indicator. So as of now I am using the coordinates of the text and I am working on one device. When switching to other device, the coordinates of the link is changed.

Wasiq Bhamla
  • 949
  • 1
  • 7
  • 12
Gerald Mur
  • 41
  • 1
  • Have you tried by using `xpath` and text? I'm assuming it's a separate `textview` – Al Imran Nov 26 '18 at 06:09
  • As of now I am currently using xpath for the textView, but there is no indicator on that specific text. I tried, FindElementByPartialText. It seems that the function is not supported by the version. Any ideas here mate? – Gerald Mur Nov 27 '18 at 00:55
  • Is there any way on how to get the coordinates of the specific text inside a textView? – Gerald Mur Nov 27 '18 at 01:07
  • Yes, but that is not the better solution: http://ezyautomation.blogspot.com/2018/08/how-to-clicktap-on-element-by-using-x.html – Al Imran Nov 27 '18 at 03:51
  • and could you please try by using this `driver.findElement(By.xpath("//*[@text='Product guide']")).click();` – Al Imran Nov 27 '18 at 03:52

0 Answers0