The tool clicks a button and a modal window appears (where I need to fill in some information and later move to parent window). But as soon as the new modal window appears, my code stops. The code resumes once I manually close the new pop up window.
Since the code itself halts, I am not able to perform any actions in the new pop up window, nor in the parent window.
WebElement addButton = driver.findElement(By.id("btnAdd"));
Finally a solution after wasting a lot of days.
The only way is to not use showModalDialog. This can be done by adding the folowing before the .click() :
which will call window.open instead of window.showModalDialog.