I need to confirm a modal popup. I have a form which I fill up and have to move to next page. When I click continue, a modal popup appears asking if the details filled are correct?
There are two button and some other description on it. One button reads cancel and other says Yes, information is correct.
I tried switching to the modal element by
driver.switchTo().frame(0); // there is only one popup
However, whatever I do with webDriver
after that results in NullPointerException
as no webelement is found.
This is what am trying
WebElement modalButtonContainer = AutoUtils.findElementByClassName(modalOverlay, "modalButtonContainer");
WebElement modalButton = AutoUtils.findElementByClassName(modalButtonContainer, "buttonClass");
modalButton.click();
But it all results in NullPointer
. How do I click the modalButton
?