嗨,我是Selendroid的新手,我想知道是否可以从android应用程序中的一个按钮启动Selendroid?
我正在尝试创建一个实现Selendroid的onClick()事件,如下所示:
public void onClick1(View view) throws InterruptedException {
switch (view.getId()) {
case R.id.button2:
/*Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);*/
SelendroidConfiguration config = new SelendroidConfiguration();
selendroidServer = new SelendroidLauncher(config);
selendroidServer.launchSelendroid();
driver = new RemoteWebDriver(DesiredCapabilities.android());
driver.get("http://www.nhl.com/ice/m_home.htm");
Thread.sleep(5000);
driver.findElement(By.cssSelector("#bodyWrap > a:nth-of-type("+2+") > div.playoffSeriesHeader > div > div > div > div ")).click();
}
}发布于 2014-06-04 13:50:05
如果您遇到这个问题,Selendroid的开发人员之一亲自回答了这里的问题。
https://stackoverflow.com/questions/23997825
复制相似问题