Unable to handle alert in internet explorer 11 using selenium C#
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.
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.
Thanks jimevans.
Is there any way to achieve the above scenario? If so, please suggest me.