Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98221

How to close parent window and continue execution on a child window

$
0
0

I have a method where I need to switch to child window to continue the the execution and I dont need the parent window anymore. So, how I can close the parent window and continue my execution on child window only?

public ServicesPage clickOnBookAppointmentLink() {
    getAction().click(SalonServicesLocators.BOOK_Service_LINK);
    HashMap<String, String> childWindowhandle = new HashMap<>();
    getWaits().waitForWindowToBeVisible(2, 60);
    childWindowhandle = getAction().getWindowHandles();
    getAction().switchToWindow(childWindowhandle, "CHILD");
    getAction().goToURL(Cont.MyURL_URL); // to navigate to the services booking page URL
    return this;

}

Viewing all articles
Browse latest Browse all 98221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>