2017-04-12 30 views
1

这段代码不适用于ExpandableListView。Android Appium Scroll UiAutomator ExpandableListView这种组合将如何工作?

driver.findElementByAndroidUIAutomator( “新UiScrollable(新UiSelector()RESOURCEID(\。” com.theentertainerme.entertainer:ID/ex_listview_locations \ “))scrollIntoView(新UiSelector()文本(\” 新加坡\“) )“); Please see attched screenshot for element hirarchy

任何帮助!我做错了什么?

java-client 4.0,appium 1.5.3 同一段代码正在为listView工作。

回答

1

为滚动试试下面的代码

Dimension size = driver.manage().window().getSize(); 
int x = size.width/2; 
int starty = (int) (size.height * 0.5); 
int endy = (int) (size.height * 0.1); 
driver.swipe(x, starty, x, endy); 

如果你想在列表中选择一个项目,然后看看下面的链接 - how to click on element in gridview in appium using java

+0

谢谢你,对我来说工作得很好。 – hmdarsh

+0

您能否接受,如果有效 – Karthikeya

+0

如何接受!!!对不起朋友,我是新手。 – hmdarsh