2016-05-04 11 views

答えて

2

UIAutomator viewe rで取得できます。起動して要素を選択します。オートビューアビューアの右隅にある座標/ピクセルを探し、要素の右から左に(その逆)ホバリングします。 sureElementはあなたが強打を実行した後(画面上の)ビューに残る要素とする:あなたは、座標が enter image description here

1

昇天を変更されて見ることができます。

あなたはピクセルが比較的今やその座標の違いを評価された移動を見つけることができる方法:

ケース1:水平スワイプを

int initialX = sureElement.getLocation().getX(); 
...perform swipe 
int finalX = sureElement.getLocation().getX(); 
int yourDesiredPixels = finalX-initialX; 

ケース2:垂直スワイプ

int initialY = sureElement.getLocation().getY(); 
...perform swipe 
int finalY = sureElement.getLocation().getY(); 
int yourDesiredPixels = finalY-initialY; //possibly this is what you are seeking 

ロケーションとx、yのコーディネートに関する深い考え方ここからさらに掘り下げることができます: https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebElement.html#getLocation--

関連する問題