简体   繁体   中英

How to acknowledge a dialog to open another application in TestCafe

I want to acknowledge a dialog which chrome prompts when it wants to open an application. So far I have tried the t.setNativeDialogHandler(() => true).click(itemToOpenDialog) but without any luck. Have anybody found a way to do this?
Link to dialog

Running:

  • testcafe 1.7.1
  • nodejs 8.12.0

The setNativeDialogHandler method is intended for the native alert/confirm/prompt, and beforeunload dialogs. It does not support the "open another application" dialog and cannot be used to interact with it.

Instead, you can verify the hyper-link's href attribute. It should contain the protocol that opens another application like "skype:...", "msteams:...", etc. If the hyper-link contains the necessary protocol, this will be sufficient for a test case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM