'how to handle swal alert popup in selenium using java....?

how to handle sweet alert popup in selenium(java) -> click on submit button in popup then redirect to next pageenter image description here

enter image description here



Solution 1:[1]

Copy > JS Path.. and then add ".click()"

document.querySelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").click();

Solution 2:[2]

As this is not a standard alert, I think you should be able to access the 'Accept' button by using the following xpath.

//div['sweet-alert showSweetAlert visible']//button[@class='confirm']

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alexherm
Solution 2 supputuri