public void countObjects() { desktop.setOption("OPT_TRUELOG_MODE", 0); int iCount = 0; int i = 0; while (desktop.exists("//BrowserApplication//BrowserWindow//INPUT[" + (i + 1) + "]")) { i++; } iCount += i; i = 0; while (desktop.exists("//BrowserApplication//BrowserWindow//SELECT[" + (i + 1) + "]")) { i++; } iCount += i; i = 0; while (desktop.exists("//BrowserApplication//BrowserWindow//BUTTON[" + (i + 1) + "]")) { i++; } iCount += i; i = 0; while (desktop.exists("//BrowserApplication//BrowserWindow//A[" + (i + 1) + "]")) { i++; } iCount += i; System.out.println("Counted " + iCount + " items."); }
26 listopada 2015
0 Likes