我在导入一些Android UI测试框架时遇到了麻烦 - 我无法弄清楚出了什么问题!
这是我的班级:
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ExampleUnitTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule(MainActivity.class);
@Test
public void listGoesOverTheFold() {
onView(withText("Hello world!")).check(matches(isDisplayed()));
}
}
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,我得到错误'找不到符号ActivityTestRule'和'找不到符号AndroidJUnit4'.我试图导入它们但是找不到它们.
build.gradle中的依赖项设置为:
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
androidTestCompile 'com.android.support.test:runner:0.4'
androidTestCompile 'com.android.support.test:rules:0.4'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Run Code Online (Sandbox Code Playgroud)
所以我认为我已经设置了所有依赖项 - 我一直在尝试很多东西,但没有运气.
有人有主意吗?
我编写了一个使用 Selenium.WebDriver.ChromeDriver 的 C# Azure 云服务,但是当我将它部署到 Azure 时它不起作用(在本地它运行良好 - 可能是因为我安装了 Chrome)。我使用我的服务部署了 chromedriver.exe,但它失败了,因为找不到 chrome.exe。我试过部署 chrome.exe 的副本,但没有奏效。我也尝试添加 GoogleChrome nuget 包,但这也不起作用。
任何人都知道获得使用 Selenium/Chromedriver 工作的 C# azure 服务的方法吗?