1

I have a local selenium grid setup that works fine on my mac and windows connected to the same network.

When i try to use an ec2 instance in this setup, then the grid isnt able to create the driver.

I am using a single ec2 instance, i.e. running the Hub and Node on it and using jenkins on that instance, i am running my test.

Now when i dont use a grid and run the test locally on ec2 instance, it works fine (i.e. use firefox driver instead of remotewebdriver)

Here is my code for driver creation

DesiredCapabilities capabilities = new DesiredCapabilities();
System.setProperty("webdriver.gecko.driver", "/usr/local/bin/geckodriver-linux");
String url = "http://15.206.186.53:5555/wd/hub";
FirefoxOptions options = new FirefoxOptions();
options.setHeadless(true);
capabilities.setCapability("browserName", "firefox");
capabilities.setCapability("marionette", true);
capabilities.setVersion("81");
capabilities.setCapability("firefoxdriverExecutable", "/usr/local/bin/geckodriver-linux");
options.merge(capabilities);
System.out.println(options.toJson());
driver = new RemoteWebDriver(new URL(url),options);

I am creating the server on ec2 using the command java -jar selenium-server.jar -role hub&

My Ec2 instance is an ubuntu 18.0.4 t2.micro. I installed nginx server also and redirected the port to use the public ip

    server {
       listen 5554;
       location / {
          proxy_pass http://15.206.186.53:5554;
       }
    } 

The error i get is

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'ip-172-31-15-4', ip: '172.31.15.4', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-1034-aws', java.version: '11.0.8'
Driver info: driver.version: unknown
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ip-172-31-15-4', ip: '172.31.15.4', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-1034-aws', java.version: '11.0.8'
Driver info: driver.version: unknown```

Am i missing anything ?


  • My Node creation ```java -Dwebdriver.gecko.driver="/usr/local/bin/geckodrer-linux" -jar selenium-server.jar -role node -browser browserName=firefox,version=81,firefox_binary=/usr/bin/firefox,maxInstances=5 -hub http://15.206.186.53:5555/grid/register -port 5554 -remoteHost http://15.206.186.53:5554&``` – Naveed Abdullah Sep 04 '20 at 07:31
  • 172.31.15.4 is the private ip of the ec2 instance. Do i need to do some routing on ec2 to route the private ip to the public ip or is there something wrong with the driver creation – Naveed Abdullah Sep 04 '20 at 07:32
  • Your gekodriver version is compatible with firefox version? – Razvan Sep 04 '20 at 09:19
  • @Razvan .. I got the solution. The driver needed permission to run. chmod u+x geckodriver fixed the issue – Naveed Abdullah Sep 05 '20 at 17:17

0 Answers0