Robotium??????????
???????????? ???????[ 2015/8/5 10:51:53 ] ??????????????????
??????????ID??????
????1 Activity act=solo.getCurrentActivity()??
????2
????3 int id=act.getResources().getIdentifier("id????"??"id"?? act.getPackageName());//id??????????????hierarchyviewer.bat??
????4
????5 View view=solo.getView(id);
???????????ID???????
????1??????????????????????????????????
?????磺RelativieLayout??????????????TextView??ImageView?????????TextView???????????RelativeLayout???
????RelativeLayout parernt=(RelativeLayout)solo.getText("").getParent();
????2??????????????????е?λ???????????
????ImeViagew search=(ImageView)parernt.getChildAt(0);
?????????????ID????????????е?????ID?????????????е?ID???????????
????ImeViagew search=(ImageView)parernt.findViewById(id);??????????
????????ListView??????????
1 //????ListView???
2 ListView listview=solo.getView(id);
3
4 //?洢?????????
5 int location[]=new int[2];
6
7 //???listiew??????
8 listview.getLocationScreen(location);
9
10 //???????????????????listview??????????????????????????0??0??
solo.drag(location[0]+10??location[0]+10??location[1]??location[1]+listview.getHeight()??3)
???????WebView????(Robotium?????????webview)
????1)?????????webview??????????????????????webview.getWeburl()??????
????2)???webview??????????webview.getTitle()???????
???????webview?е????з????????UI????в?????????????????
1 solo.getCurrentActivity().runOnUiThread(new Runnable() {
2
3 @Override
4 public void run() {
5 webViewTitle = webView.getTitle();
6 Log.i(Constants.LOG_TAG ??"??????webview??Title:" + webViewTitle);
7 }
8 });
????Solo?й???webview???????
????clearText InWebElement(By by)
????clickOnWebElement(By by)
????enterTextInWebElement(By by??String text)
????waitForWebElement(By by)
????????Щ?????п????????????п??????By???????
??????By??????:
????By.className() //???css???????????????
????By.cssSelector() //???????????css?????????
????By.id()//?????id
????By.name()//?????????
????By.tagName()// ???????????<p>.
????By.TextContent()//????е????
????By.xpath()
???????磺solo.clickOnWebElement(By.className("link-ele")??0);//????????????????????0??λ????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11