我是移动自动化的新手。如何使用响应式设计预设创建Firefox配置文件?
答案 0 :(得分:1)
您需要设置devtools.responsiveUI.presets
firefox偏好设置。
示例,使用Python:
import json
from selenium import webdriver
presets = [
{
"key": "480x800",
"name": "Google Nexus one",
"width": 480,
"height": 800
},
# TO FILL
{
"key": "1680x1050",
"name": "Desktop - stat 2.96%",
"width": 1680,
"height": 1050
}
]
profile = webdriver.FirefoxProfile()
profile.set_preference('devtools.responsiveUI.presets', json.dumps(presets))
driver = webdriver.Firefox(profile)
另见,见: