private boolean ClickByCollInfo(int CLICK, String classname, String id, String text) {

        UiSelector uiselector = null;
        UiCollection musicList = null;
        switch (CLICK)
        {
            case CLICK_CLASS:
                musicList = new UiCollection(new UiSelector().className(classname));
                uiselector = new UiSelector().resourceId(id).text(text);
                break;
            default:
                return false;
        }
        UiObject uiobject = null;
        try {
             uiobject = musicList.getChild(uiselector);
        } catch (UiObjectNotFoundException e) {
            e.printStackTrace();
        }
        int i = 0;
        if(!uiobject.exists()) return false;
        try {
            uiobject.click();
        } catch (UiObjectNotFoundException e) {
            e.printStackTrace();
        }
        return true;
    }

  

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2021-08-05
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2021-12-30
  • 2021-06-12
猜你喜欢
  • 2021-07-17
  • 2021-08-19
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案