How to automate Firefox Mobile with Selenium?

前端 未结 2 1705
别那么骄傲
别那么骄傲 2021-01-19 04:39

I need to run Selenium tests in Firefox Mobile. Could anybody describe an easy way to do this? My investigation shows that:

  1. Firefox Mobile is not supported in
2条回答
  •  长情又很酷
    2021-01-19 05:05

    binary = FirefoxBinary('geckodriver.exe')
    capabilities = {
        'browserName': 'firefox',
        'firefoxOptions': {
            'mobileEmulation': {
                'deviceName': 'iPhone X'
            }
        }
    }
    
    browser = webdriver.Firefox(firefox_binary=binary, desired_capabilities=capabilities)
    

    This should work. Havent tested it so try it and let me know.

提交回复
热议问题