selenium - Creating Firefox profile with responsive design preset -
i new mobile automation. how can create firefox profile responsive design preset?
you need set devtools.responsiveui.presets
firefox preference.
example, using python:
import json selenium import webdriver presets = [ { "key": "480x800", "name": "google nexus one", "width": 480, "height": 800 }, # 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)
also, see:
Comments
Post a Comment