无法在Chrome中运行portractor测试

时间:2017-05-04 02:53:23

标签: javascript automation protractor

我无法在Chrome浏览器中运行示例量角器测试。

这是我的config.js文件。

exports.config = {


    capabilities: {
    "browserName": "chrome",
    "chromeOptions": {
        binary: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
        args: [],
        extensions: [],
    }
},
  seleniumAddress: 'http://localhost:4444/wd/hub',

  onPrepare: function() {
    var width = 1600;
    var height = 1200;
    browser.driver.manage().window().setSize(width, height);
},
  specs: ['C:/Users/Desktop/spec.js'],
};

这是spec.js文件

describe('Guru99 Test', function() {
 it('should add a Name as GURU99', function() {
  browser.get('www.guru99.com');
    //expect(browser.getTitle().toEqual("Meet guru99"))
  element(by.xpath("//*[@href='/software-testing.html']")).click();
  var guru= element(by.xpath('html/body/div[2]/div[1]/div[2]/div[2]/div/h3'));
  expect(guru.getText()).toEqual('Hello change GURU99!');
browser.driver.sleep(5000);
  });
});

打开chrome,输入数据;到URL,然后同样输入HTML标签片刻,然后打开URL,但什么都不做......

如何解决这个问题?

Chrome版本 - 58.0 量角器版本 - 5.1.1

提前致谢。

1 个答案:

答案 0 :(得分:0)

通过放置http://www.guru99.com而不是www.guru99.com并独立运行selenium来解决此问题。

相关问题