我創建了一個簡單的活動,其中有2個用於提交和取消的按鈕。我只是想通過使用UI Automator測試來測試這個項目。所以我創建了一個android測試項目並創建了一個類。我使這個測試課程延伸至UiAutomatorTestCase
。我還添加了uiautomator.jar,android.jar以及junit3庫。但是當我運行測試用例時,它給我提供了一個錯誤Android UiAutomator測試
TestSuiteConstruction失敗和java.lang.RuntimeException。
但是我添加了構造函數,但是因爲它沒有使用任何參數,所以我無法添加任何參數。這是我的測試用例代碼。請儘快解決此錯誤。你能告訴我任何我沒有加入我的項目的東西嗎?
package com.example.automatorapp.test;
import android.test.suitebuilder.TestSuiteBuilder;
import android.util.Log;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
import com.example.automatorapp.MainActivity;
public class testDemo1 extends UiAutomatorTestCase
{
public testDemo1()
{
}
public void testdemo() throws UiObjectNotFoundException
{
getUiDevice().pressHome();
Log.e("how r u","hello");
}
}
pleasse回覆某人??其緊急!!!! – Aditya 2013-03-28 06:07:51
可能重複[UIAutomator junit testsuite error](http://stackoverflow.com/questions/15674279/uiautomator-junit-testsuite-error) – THelper 2013-03-28 11:52:59