量角器:“ WebDriverError:无法根据以下类型确定类型:E。最后1个字符为:E”

时间:2018-11-27 10:31:30

标签: webdriver protractor iedriverserver

我正在尝试使用Internet Explorer在量角器中运行测试。 运行conf.js文件时,我收到以下消息,

WebDriverError:无法从以下类型确定类型:E.最后1个字符为:E构建信息:版本:'3.141.59',修订版:'e82be7d358',时间:'2018-11-14T08:25:53'系统info:主机:'VMWXSUGAV-DE03',ip:'10 .32.138.64',os.name:'Windows 10',os.arch:'amd64',os.version:'10 .0',java.version:'9.0。 4'驱动程序信息:driver.version:未知

我从另一个主题读到,该主题通过在conf.js文件中进行以下更改而得以解决。 另一个帮助主题的声明:

我通过使onPrepare()使用async(即,将onPrepare()更改为async onPrepare()并更改browser.driver.manage()。window()。maximize();来等待browser.driver.manage( ).window()。maximize();

我的问题: 我不确定在conf.js文件中将onPrepare()使用异步的位置。如果有人可以帮助我,那就太好了。

我的conf.js文件

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
var today = new Date(),
  timeStamp = today.getMonth() + 1 + '-' + today.getDate() + '-' + today.getFullYear() + '-' + today.getHours() + 'h-' + today.getMinutes() + 'm';
var reporter = new Jasmine2HtmlReporter({
  consolidateAll: true,
  savePath: 'reports/',
  takeScreenshots: true,
  filePrefix: 'index -' + today
});

exports.config = {
  directConnect: false,

  capabilities: {
    'browserName': 'internet explorer'
  }, 

  /* multiCapabilities: [
    {'browserName': 'chrome'},
    {'browserName': 'firefox'},

  ], */

  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',

  // We can mention the number of test scripts to be executed inside a suite by calling their file names.
  suites: {

       one: 'BudgetNewForm.js',

  },

  // Options to be passed to Jasmine.
  jasmineNodeOpts: {
    defaultTimeoutInterval: 360000
  },
  allScriptsTimeout: 360000,
  onPrepare: function () {
  jasmine.getEnv().addReporter(reporter);
  }

};

我的Testscript文件:

"use strict";
var util = require('util');
describe('Budget Setup form', function () {

    var homescreen = require('./../BFRWEB_Automation//BudgetHomeScreen.po.js');

    it('verify Net revenue calculation', function () {

        beforeAll(function () {
            browser.executeScript('window.sessionStorage.clear();'); //clear session
            browser.executeScript('window.localStorage.clear();'); //clear local storage
        });
        debugger
        browser.waitForAngularEnabled(false);
        homescreen.get_QAurl();
        homescreen.NavigatetoBudgetasUser1();
        browser.driver.sleep(10000);
        homescreen.clickRevenue();

        function sumValueInColumn(tableID, columnNumber, expectedResult){
            var expectedCells = element.all(by.css('.'+dx-datagrid-content+' tr td:nth-of-type(2)'));
            var currentSum = 0;
            expectedCells.each((eachCell) => {
                eachCell.getText().then((cellText) => {                            
                    currentSum += Number(cellText);
                });

            }).then(() => {
                expect(currentSum.toString()).toEqual(expectedResult);
            });
        };//END OF sumValueInColumn

    });

});

0 个答案:

没有答案