Android自动化测试工具-Robotium 4.0发布啦!

发表于:2013-03-27来源:网易杭州 QA Team作者:黄庆兵点击数: 标签:Robotium
Android自动化测试工具-Robotium 我们很高兴的看到官方(http://code.google.com/p/robotium/)终于发布Robotium 4.0版本,这是有史以来最大的一次单独版本更新,并提供了Web支持,现在,Robotium可以和你的hybird apps交互了。searchText(), waitForText(), clickOnText

  我们很高兴的看到官方(http://code.google.com/p/robotium/)终于发布Robotium 4.0版本,这是有史以来最大的一次单独版本更新,并提供了Web支持,现在,Robotium可以和你的hybird apps交互了。searchText(), waitForText(), clickOnText(),scroll() , takeScreenShot()等方法,现在也很好的支持WebViews。

  Robotium 4.0版本中,略去了许多内部细节,改为更为稳定快速的测试执行方式。比如,更新了类RobotiumUtils,新增了用于过滤、排序和操作Views的方法。也引入了WebElement类,用于操作WebViews里识别到的元素。

  Robotium 4.0新增方法:

  - waitForCondition(Condition condition, final int timeout)- waitForWebElement(By by) //Example: waitForWebElement(By.id("id"));- waitForWebElement(By by, int timeout, boolean scroll)- waitForWebElement(By by, int match, int timeout, boolean scroll)- clickOnWebElement(WebElement webElement)- clickOnWebElement(By by)- clickOnWebElement(By by, int match)- clickOnWebElement(By by, int match, boolean scroll)- enterTextInWebElement(By by, String text)- typeTextInWebElement(By by, String text)- typeTextInWebElement(By by, String text, int match)- typeTextInWebElement(WebElement webElement, String text)- clearTextInWebElement(By by)- getWebElement(By by, int index)- getCurrentViews(Class classToFilterBy)- getCurrentViews(Class classToFilterBy, View parent)- takeScreenshot(String name, int quality)

  类RobotiumUtils更新的方法:

  - removeInvisibleViews(Iterable viewList)- filterViews(Class classToFilterBy, Iterable viewList)- filterViewsToSet(Class classSet[], Iterable viewList)- sortViewsByLocationOnScreen(List views)- sortViewsByLocationOnScreen(List views, boolean yAxisFirst)- getNumberOfMatches(String regex, View view, Set uniqueTextViews)

  删除的方法:

  - getAllOpenedActivities()- finishInactiveActivities()- getCurrentXViews //replaced by getCurrentViews(Class classToFilterBy). Example: getCurrentViews(ListView.class)

  这里先初探一下Robotium 4.0的变化和特性,有待后续更深入的研究。总的来说,Robotium 4.0比以前更完善,并支持Web控件!如果有需要者,赶紧尝鲜一试吧(猛击下载)!

原文转自:http://qa.blog.163.com/blog/static/1901470022013212517881/