我無法使用java在appium中的混合應用程序的底部向下滾動頁面。我正在使用Appium v1.6.3如何使用java在混合應用程序的appium中向下滑動頁面。
-2
A
回答
0
您可以使用滑動方法從下往上滑動。
ds.swipe(startx,starty,endx,endy,500);
或
可以使用
0
(「元素的名稱」)scrollto由於它是混合應用程序,然後我們首先要改變Native_APP後來我們申請下面的代碼
Dimension size = driver.manage().window().getSize();
System.out.println(size);
//Find swipe start and end point from screen's with and height.
//Find starty point which is at bottom side of screen.
int starty = (int) (size.height * 0.70);
//Find endy point which is at top side of screen.
int endy = (int) (size.height * 0.20);
//Find horizontal point where you wants to swipe. It is in middle of screen width.
int startx = size.width/2;
System.out.println("starty = " + starty + " ,endy = " + endy + " , startx = " + startx);
0
這是我嘗試向下滾動側面菜單,找到一個註銷
//向下滑動側菜單,然後點擊註銷
@Test
public void T4b_logout() throws InterruptedException{
size = driver.manage().window().getSize(); //Get the size of screen.
System.out.println(size);
int starty = (int) (size.height * 0.80);//Find starty point which is at bottom side of screen.
int endy = (int) (size.height * 0.20); //Find endy point which is at top side of screen.
int startx = size.width/2; //Find horizontal point where you wants to swipe. It is in middle of screen width.
System.out.println("starty = " + starty + " ,endy = " + endy + " , startx = " + startx); // int startx = size.width;
driver.swipe(startx, starty, startx, endy, 3000);//Swipe from Bottom to Top.
Thread.sleep(2000);
driver.findElement(By.name("Logout")).click();
driver.findElement(By.xpath("//android.widget.Button[@text='Ok']")).click();
}
相關問題
- 1. 如何使用appium + Java在Android應用程序中滾動?
- 2. 如何使用appium在IOS7中滑動?
- 3. Cordova混合應用程序使用appium的問題
- 4. Appium:如何使用Java在iOS應用程序中向下滾動下拉菜單
- 5. 使用Java的Appium滑動是不可能在iOS應用程序
- 6. 如何使用appium驅動程序在android應用程序中自動執行移動版本頁面
- 7. 使用混合移動應用程序防止逆向工程?
- 8. 使用Appium測試Cordova混合移動應用程序的步驟
- 9. iOS混合應用程序-Appium click()不起作用
- 10. 如何在Swing應用程序中混合Java Swing和JavaFX?
- 11. 混合asp.net Forms和MVC應用程序中的頁面繼承
- 12. 使用Appium啓動應用程序
- 13. 如何在Sinatra應用程序中混合使用Ruby和HTML5?
- 14. 在Web應用程序中滑動頁面
- 15. Appium的混合應用測試
- 16. 使用Selenium Web Driver(Appium)向下滾動使用Java
- 17. 如何在Appium + Python中滾動頁面
- 18. 在Android應用程序的開發頁面之間滑動
- 19. 混合應用程序中的頁面是否被轉換爲活動
- 20. 如何向下滑動以關閉Xcode中的當前頁面
- 21. 使用Appium-android在原生應用中滑動操作
- 22. 如何在混合應用程序的html頁面中以編程方式禁用android中的預測文本
- 23. 無法使用Appium&Protractor從混合應用程序切換到com.mobile.safari
- 24. 如何使用$ .mobile.changePage()更改多頁混合應用程序文件中的頁面?
- 25. 如何使用Appium執行在iOS設備上左滑動使用Appium
- 26. 如何使用移動Chrome和Appium測試應用程序
- 27. 如何使用appium自動化cocos2dx(Open GL View)應用程序
- 28. Google即時應用程序 - 如何使用Appium自動化
- 29. 向左/向右滑動網頁,但使用默認向上/向下滑動
- 30. Android Pay在混合應用程序中