2017-04-12 27 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