开发者

Need a way to perform auto confirm for firefox or any other browser popup's

开发者 https://www.devze.com 2023-01-04 15:09 出处:网络
Is there a way to auto confirm popup. For example i\'m deletin开发者_StackOverflowg file via firefox this operation triggers a confirmation popup when the options are ok and cancel.

Is there a way to auto confirm popup. For example i'm deletin开发者_StackOverflowg file via firefox this operation triggers a confirmation popup when the options are ok and cancel.

In this case i need to click on ok button automatically.


Found a way to do this in C#:

Perform the desired action (like delete) and then:

    SendKeys.SendWait("{ENTER}"); //in case if the focus was on ok button


    SendKeys.SendWait("{TAB}"); //in case if the focus was on cancel button
    SendKeys.SendWait("{ENTER}"); 
0

精彩评论

暂无评论...
验证码 换一张
取 消