【问题标题】:How to run protractor to validate CHROME on AWS如何在 AWS 上运行量角器来验证 CHROME
【发布时间】:2014-03-07 19:11:49
【问题描述】:

我正在使用 AngularJS / JBOSS 构建一个 SaaS 解决方案,托管在 AWS EC2 实例上;我们所有的功能都包含在单元测试和 e2e 测试中。所有测试在本地运行良好。我们无法弄清楚如何在 AWS 上运行它们。我们的 AWS 安装包括一个无头 CHROME,按照these instructions 安装:

复制步骤

  1. 在基于 linux 的 x86_64 EC2 实例中设置 chrome/firefox
  2. 启动webdriver-manager start
  3. 在单独的终端窗口中,启动量角器

观察到的行为 1、webdriver终端显示如下错误:

/usr/local/lib/node_modules/protractor/selenium/chromedriver: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
06:41:15.140 WARN - Exception thrown

预期行为 1.量角器测试执行无误

其他资源: 1.量角器配置文件

exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',

    specs: ['../test/e2e/**/*.js'],

    // A base URL for your application under test. Calls to browser.get()
    // with relative paths will be prepended with this.
    baseUrl: 'http://localhost:8080/markodojo_solution/#/a3bc8692-5af4-4a4d-b21b-4e6f87dc2a32',

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true,
        isVerbose: true,
        defaultTimeoutInterval: 30000
    },

    //Options to output testreuslts in xml format
    onPrepare: function() {
    // The require statement must be down here, since jasmine-reporters
    // needs jasmine to be in the global and protractor does not guarantee
    // this until inside the onPrepare function.
    require('jasmine-reporters');
    jasmine.getEnv().addReporter(
      new jasmine.JUnitXmlReporter('xmloutput', true, true));
  }
};

提前感谢您的帮助!

【问题讨论】:

  • 只是检查,但是...你安装了libgconf-2吗?
  • 不,我没有。我现在就去做,然后回来报告。
  • 我无法安装 libconf-2,yum install ligcong-2 产生无可用软件包消息。有人建议我尝试安装 gconf2 但不幸的是我得到了同样的错误。我还尝试了从网络搜索中找到的所有可能的替代方案,但无济于事!
  • 嗨.. 卡在你一年前的同一点上:) 关于你如何进行的任何指示?我遇到了同样的错误:/usr/local/lib/node_modules/protractor/selenium/chromedriver: 加载共享库时出错:libgconf-2.so.4: 无法打开共享对象文件:没有这样的文件或目录跨度>

标签: angularjs google-chrome selenium-webdriver amazon-ec2 protractor


【解决方案1】:

使用 Headless Chrome 选项

这大大简化了工作流程,并且不得不使用更多的系统资源。

按照以下大致步骤:

  1. Chrome 安装。假设您已经在那里安装了 Chrome。但是,如果不关注steps to install Chrome on linux EC2
  2. 将量角器选项更改为如下所示。重要的是--headless。另外请记住,无头模式需要预先指定浏览器大小:-

      chromeOptions: {
         args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
       }
    

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多