拒绝在OpenShift firefox硒节点上进行Nighwatch测试

时间:2019-02-20 08:05:56

标签: javascript selenium vue.js openshift nightwatch.js

我尝试在OpenShift内的Selenium集线器上使用Nightwatch.js框架运行测试。 Selenium集线器与Chrome和Firefox节点连接。 Chrome节点工作正常,但Firefox节点返回以下错误消息:

  

从硒服务器检索新会话时出错    拒绝连接!硒服务器启动了吗?

fileApiService.downloadFile(fileId)
.then(function (response) {
    var data = response.data;

    function b64toBlob(b64Data, contentType, sliceSize) {
        contentType = contentType || '';
        sliceSize = sliceSize || 512; // sliceSize represent the bytes to be process in each batch(loop), 512 bytes seems to be the ideal slice size for the performance wise 

        var byteCharacters = atob(b64Data);
        var byteArrays = [];

        for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
            var slice = byteCharacters.slice(offset, offset + sliceSize);

            var byteNumbers = new Array(slice.length);
            for (var i = 0; i < slice.length; i++) {
                byteNumbers[i] = slice.charCodeAt(i);
            }

            var byteArray = new Uint8Array(byteNumbers);

            byteArrays.push(byteArray);
        }

        var blob = new Blob(byteArrays, { type: contentType });
        return blob;
    }

    var blob = b64toBlob(data, 'application/octet-stream');

    FileSaver.saveAs(blob, 'file.zip');
})
.catch(function () {
    // ...
});

我的守夜人配置文件看起来像这样(硒中心的URL是占位符):

firefox   { value:
 { sessionId: '751cb7ff-d937-40c4-b88b-01730556fee8',
   capabilities:
    { acceptInsecureCerts: true,
      browserName: 'firefox',
      browserVersion: '65.0',
      'moz:accessibilityChecks': false,
      'moz:geckodriverVersion': '0.24.0',
      'moz:headless': true,
      'moz:processID': 1106,
      'moz:profile': '/tmp/rust_mozprofile.jRFfe02blKzB',
      'moz:shutdownTimeout': 60000,
      'moz:useNonSpecCompliantPointerOrigin': false,
      'moz:webdriverClick': true,
      pageLoadStrategy: 'normal',
      platformName: 'linux',
      platformVersion: '3.10.0-957.1.3.el7.x86_64',
      rotatable: false,
      setWindowRect: true,
      strictFileInteractability: false,
      timeouts: [Object],
      unhandledPromptBehavior: 'dismiss and notify',
      'webdriver.remote.sessionid': '751cb7ff-d937-40c4-b88b-01730556fee8' 
      } 
  } 
}

我项目中的geckodriver版本为1.15.1,应该与OpenShift上的geckodriver版本兼容。

有人知道我在做什么错吗?预先谢谢你!

0 个答案:

没有答案