python - 在 Robot Framework 中创建 Firefox 配置文件
问题描述
需要创建一个 Firefox 配置文件运行时并为 Robot Open Browser 关键字提供配置文件路径
当前代码能够创建 Firefox 配置文件对象,但无法提取 Firefox 配置文件路径
Create Firefox Profile
[Arguments] ${DOWNLOADS_DIRECTORY}
${firefox_profile}= Evaluate sys.modules['selenium.webdriver'].FirefoxProfile() sys, selenium.webdriver
${mime_types}= Convert To String application/octet-stream;application/vnd.ms-excel;text/plain;application/xml;text/comma-separated-values
Call Method ${firefox_profile} set_preference browser.download.folderList 1
Call Method ${firefox_profile} set_preference browser.download.manager.showWhenStarting False
Call Method ${firefox_profile} set_preference browser.download.dir ${DOWNLOADS_DIRECTORY}
Call Method ${firefox_profile} set_preference browser.helperApps.neverAsk.saveToDisk ${mime_types}
Call Method ${firefox_profile} update_preferences
[Return] ${firefox_profile}.path
解决方案
推荐阅读
- javascript - v-for 循环在运行后打印空行
- php - 从验证 MessageBag 中替换消息数组
- c# - How to update Enum value in ASP.NET Core MVC?
- ios - __OBJC2__ 在哪里?
- wordpress - 为类别的 woocommerce 单品添加自定义文本
- java - can you help me how to breakdown the denomination of my change? I've been searching everywhere how to do it but I still don't get it
- sqlite - SQ Lite 使用 LIKE 函数仅查找两个或三个单词
- r - 在 R 中读取 .dta 文件时出错
- c# - ECDH 与 HKDF 使用 c#
- apache-zookeeper - Solr 耗尽所有物理内存/磁盘缓存