0

https://docs.aws.amazon.com/devicefarm/latest/testgrid/testing-frameworks-nodejs.html

After following above link, I am trying to run Protractor scripts on Device Farm, however scripts are getting executed on my local machine instead of being executed on AWS Cloud machines (i.e. browser instance is opening on my personal laptop). Please advise what changes I need to do to make it run on cloud virtual machine?

Below is my conf.js code:

exports.config = {
  specs: ['ABC.js'],
  hostname: "testgrid-devicefarm.us-west-2.amazonws.com",        
  port: 443,    
  path: "xyz../wd/hub",
  protocol: "https"  }

Below is the output:

Selenium standalone server started at http://xxx.yyy.x.y:xxxxx/wd/hub
    Started
    1 spec, 0 failures
    Finished in 6.941 seconds
    [21:17:42] I/local - Shutting down selenium standalone server.
    [21:17:42] I/launcher - 0 instance(s) of WebDriver still running
    [21:17:42] I/launcher - firefox #01 passed

(Note: I was able to run Selenium scripts successfully on Device Farm. Only issue I am facing is with Protractor)

mayank
  • 3
  • 2

1 Answers1

0

NOTE: Let me preface this by saying that Protractor v5 and v7 does not support the W3C specification / Selenium 4, and thus cannot be used on AWS Device Farm (see the Github issues [1] and [2]) as the AWS service requires it.


To connect to a remote address using the URL AWS Device Farm provides, the seleniumAddress parameter can be used in the conf.js.

Here's an example of a config on Protractor v6

exports.config = {
    framework: 'jasmine',
    seleniumAddress: <Your Remote URL>,
    specs: ['spec.js'],
    capabilities: {
        browserName: 'firefox'
    }
}
Tobe E
  • 628
  • 7
  • 14
  • Thanks for your response. Yes, you seem to be right about W3C specification. Further I tried with most of the recent protractor versions (https://www.npmjs.com/package/protractor?activeTab=versions), however still no luck. It seems Device Farm doesn't support Protractor till date Their official documentation about Device Farm with Node.Js also mentions only about webdriver.io only (instead of protractor). – mayank Jul 14 '20 at 06:11
  • In addition to above comment, I also tried providing DeviceFarm URL as in the line below, but it didnt worked. It seems we have to wait until, we get official documentation for Protractor with Device Farm from AWS. seleniumAddress: 'https://testgrid-devicefarm.us-west-2.amazonaws.com:443/abc...=/wd/hub' Output/Error: [12:47:09] E/launcher - Create Session request doesn't have capabilities defined... .. [12:47:09] E/launcher - Process exited with error code 199 – mayank Jul 14 '20 at 17:18
  • Right, this is due to Protractor v5 and v7 not passing w3c capabilities to AWS Device Farm's service, so the request gets rejected by Device Farm. There's supposedly a workaround for v5 mentioned on [another stack post](https://stackoverflow.com/questions/58457533/protractor-w3c-capability), but your mileage of it may vary since it is not officially supported by Protractor – Tobe E Aug 04 '20 at 22:50