【问题标题】:Is it possible to run chrome in mobile emulation mode with Selenium Server with InternJS是否可以使用 Selenium Server 和 InternJS 在移动仿真模式下运行 chrome
【发布时间】:2016-08-04 12:31:48
【问题描述】:

我正在尝试使用本地 Selenium 服务器运行 Intern JS 功能测试用例。 我正在尝试在移动模拟模式下使用 chrome 运行测试用例。但是,我无法找出正确的配置。

我尝试过使用这个环境。

environments: [ { browserName: 'chrome'} , 'mobileEmulation': { "deviceName": "Google Nexus 5", "deviceMetrics": {'width': 360, 'height': 640, 'pixelRatio': 3}} } ],

我也试过 capabilities: { 'selenium-version': '2.53.1', 'idle-timeout': 30, "screen-resolution": "360x640" }

capabilities: { 'selenium-version': '2.53.1', 'idle-timeout': 30, 'mobileEmulationEnabled': true }

这可能吗?

【问题讨论】:

    标签: google-chrome selenium testing mobile intern


    【解决方案1】:

    尝试使用capabilities.chromeOptions.mobileEmulation 中定义的移动设置:

    environments: [
      { browserName: 'chrome'},
    ],
    
    capabilities: {
      chromeOptions: {
        mobileEmulation: { 
          deviceName: "Google Nexus 5",
          deviceMetrics: {
              width: 360, 
              height: 640, 
              pixelRatio: 3
          }
        }
      }
    },
    

    【讨论】:

    • 有效!但是,我需要单独使用 deviceName 或 deviceMetrics 。 from unknown error: 'deviceName' must be used alone
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-05
    • 1970-01-01
    • 2020-08-24
    • 2012-05-04
    • 2015-10-29
    • 2018-10-23
    • 2018-12-21
    相关资源
    最近更新 更多