【发布时间】:2020-12-10 16:22:01
【问题描述】:
打开外部应用程序?
https://webiste.com 想要打开这个应用程序。
[x] 始终允许 website.com 在相关应用中打开此类链接
[取消] [打开外部应用程序]
我正在尝试自动化使用外部应用程序的流程。 Chrome 正在请求打开应用程序的权限(见上文),但我无法找到自动与该对话框交互的方法。
有人建议我可以通过将命令行参数传递给 Chrome 来禁用该对话框。我收到了这个list,但它很大,我找不到任何看起来有用的东西。
如果有人曾经设法使使用外部应用程序的某些东西自动化,请告诉我你是如何做到的。谢谢。
编辑:
这些是自动化框架用于启动 Chrome 的参数:
使用以下标志启动 Google Chrome:--enable-automation --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded- windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor -- disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features =site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900
我可以轻松添加标志。不确定是否要删除标志。
【问题讨论】:
-
这是您尝试下载文件的时候吗?或者点击一个链接(如电子邮件或电话号码)?
-
超级用户回答了这个问题:superuser.com/a/1518982/997288
-
@WSC 这当然很有趣,但我不知道如何将其整合到我的自动化中。我的普通 Chrome 浏览器已经配置为始终允许该协议。自动化框架启动的 Chrome 实例总是询问,即使我选中了总是允许框。考虑到在运行自动化时您不希望行为依赖于本地系统上的用户设置,这是有道理的。如果你想知道它是如何启动的,我可以用它用来启动 Chrome 的标志来更新我的答案。
-
@DMart 这是打开特定应用程序的自定义链接。例如,当您单击链接以加入 MS Teams 会议时。在这种情况下,应用程序只是执行一些后台任务并向网站报告。
-
所以您想测试浏览器启动第 3 方应用程序的功能吗?你这个项目的最终目标是什么?
标签: selenium google-chrome automation puppeteer webdriver-io