selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Unable to handle alert in internet explorer 11 using selenium C#

Open manoece90 opened this issue 9 years ago • 2 comments

I have created a javascript alert using IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("alert('start');"); and trying to close the alert by using driver.SwitchTo().Alert().Accept(); which is not working in IE11 and same has been working fine in chrome browser. Can anyone pls help me to solve this issue asap.

manoece90 avatar Nov 10 '17 18:11 manoece90

This is not a supported scenario in the IE driver at this time. If you create a blocking script (which throwing alert(), confirm(), or prompt() does) and execute it in the driver via executeScript, you will be blocked. You won't be able to dismiss the resulting alert via code, because your thread is blocked until the alert is dismissed. This is simply a limitation of the driver at this time.

jimevans avatar Nov 10 '17 20:11 jimevans

Thanks jimevans.

Is there any way to achieve the above scenario? If so, please suggest me.

manoece90 avatar Nov 11 '17 04:11 manoece90