我正在尝试使用本地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 }

这有可能吗?

最佳答案

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

environments: [
  { browserName: 'chrome'},
],

capabilities: {
  chromeOptions: {
    mobileEmulation: {
      deviceName: "Google Nexus 5",
      deviceMetrics: {
          width: 360,
          height: 640,
          pixelRatio: 3
      }
    }
  }
},

关于google-chrome - 是否可以通过带有InternJS的Selenium Server在移动仿真模式下运行chrome,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38767438/

10-17 00:39