In one application, there is a child window, which opens another window. In total there are three windows. The window handles and the titles of each window are dynamic, they change every session.
So I stored the handles of the parent window and the first child window, then I called getWindowHandles method, stored all handles in a set, removed parent window and first child window. The remaining window handle in the set will be the third window handle.
Set<String> windowHandles = uiDriver().getDriver().getWindowHandles(); windowHandles.remove(parentHandle); windowHandles.remove(firstChildHanlde); String thirdChildHandle = windowHandles.toString(); It would be of great help if you can help me on how to get the child window handle in a more convenient way.