如何在appium中的textview中单击文本链接

问题描述 投票:5回答:1

如何在appium中的textview中单击文本链接

对于前我有一个字符串,没有帐户? Register

只有Register有一个链接,其他文本被禁用,当我点击注册它导航到注册屏幕。

但我无法点击注册。

参考图像enter image description here

java automated-tests appium uiautomator appium-android
1个回答
0
投票
WebElement element = driver.findElement(By.id("element id here"));
Point point = element.getLocation();

//you can change follwing point based on your link location
int x = point.x +1;  
int y = point.y + element.getSize().getHeight() - 1;

new TouchAction(driver).tap(x, y).perform();

我发现这个解决方案here in appium discussion

© www.soinside.com 2019 - 2024. All rights reserved.