2014-02-26 65 views
0

我對IOS7使用Appium 0.15。我試圖用滾動功能與下面的代碼無法在Appium中使用滾動功能

final JavascriptExecutor jsExecutor = (JavascriptExecutor) getDriver(); 
     final Map<String, String> scrollObject = new HashMap<String, String>(); 
     scrollObject.put("direction", "up"); 
     System.out.println("Scroll object:"+scrollObject.size()); 
     jsExecutor.executeScript("mobile: scroll", scrollObject); 

但在執行這個代碼我得到以下異常

org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 13 milliseconds 
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15' 
System info: host: 'Automation-MAC-2.local', ip: '10.0.25.155', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.8.4', java.version: '1.7.0_45' 
Session ID: c2b31197-7090-4458-9aca-dea6793ee2c5 
Driver info: org.openqa.selenium.remote.RemoteWebDriver 
Capabilities [{app=/Users/Wiley/Documents/JASAPPS/JGRD_simulator.app, platform=MAC, javascriptEnabled=true, databaseEnabled=false, browserName=iOS, webStorageEnabled=false, device=iPhone, locationContextEnabled=false, applicationCacheEnabled=true, takesScreenshot=true, version=6.1}] 

請幫我解決這個問題

+0

更新到最新版本的appium 1.2.2以獲得更廣泛的功能集。 – NeilJaff

+0

@Parosh,上面的「mobile:scroll」/「mobile:scrollTo」已折舊,請查看此視頻,其中顯示最新的appium版本1.5.3支持的命令, https://www.youtube.com/watch?v=bT3tqaLNn -Y – Manidroid

回答

1

您使用的是舊版本appium的升級爲設置更大的功能的最新版本!

"org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html (WARNING: The server did not provide any stacktrace information)" 
1

使用下面的代碼。它將工作

  WebElement element = driver.findElement(By.id("android:id/select_dialog_listview")); 
      HashMap<String, String> scrollObject = new HashMap<String, String>(); 
      scrollObject.put("text", "The text you need to scroll to"); 
      scrollObject.put("element",((RemoteWebElement) element).getId()); 
      driver.executeScript("mobile: scrollTo", scrollObject);