How to start protractor to check CHROME on AWS

I am creating a SaaS solution using AngularJS / JBOSS hosted on an AWS EC2 instance; all of our functionality is covered by modules and e2e tests. All tests run normally locally. We cannot figure out how to run them on AWS. Our AWS installation includes a headless CHROME installed in accordance with these instructions :

Playback Steps

  • Configure chrome / firefox on Linux x86_64 EC2 instance
  • Launch launch webdriver-manager
  • In a separate terminal window, launch the protractor

Observed behavior 1. The following error is displayed on the webdriver terminal:

/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 

Expected Behavior 1. Protractor test runs without errors

Additional resources : 1. Protractor configuration file

 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)); } }; 

Thanks in advance for your help!

+7
angularjs google-chrome amazon-ec2 selenium-webdriver protractor
source share
1 answer

Go with the Chrome option without Chrome.

This greatly simplifies the workflow and requires more system resources.

Follow the broad steps below:

  • Install Chrome. Suppose you already have Chrome installed. However, if you do not complete the steps to install Chrome on Linux EC2
  • Change the protractor settings to something like below. Important is --headless . Also, keep in mind that headless mode requires the browser size to be specified in advance: -

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

All Articles