Hello I want to learn how to switch in in to a new windows without using thread sleep. I was trying to use awaitility artifact but I was not able to done it correctly. I was trying to automate print window. When I click on print icons on my web page I navigate to print window I want to wait while navigating to print window and once print window displayed I want to click on cancel button. Can someone help me for that
Print_icon.click();
await().atMost(10,TimeUnit.SECOND).pollInterval(1,TimeUnit.SECONDS);
Cancel_button.click();