Now I got you. That's right, executeScript blocks all your apps until it is finished. The problem here is that Ranorex can't close the messageBox since it is blocked too.
The solution is the following:
webDocu.ExecuteScript("window.setTimeout(function() { alert('MyMessageBox'); }, 10);"); Button buttonOK = "/form[@title='Message from webpage']/button[@text='OK']"; buttonOK.Click();Now your function to be executed is the setTimeout (which is in this case finished in 10 ms). After this, the message box is popping up and you can go on as usual.
Hope it will work now.
Regards,
Larissa
Ranorex Support Team