'Why Selenium-Standalone service takes a lot more time to launch browser than chrromedriver with webdriverIO [closed]

I am running a small test using webdriverIO. I have default configuration of everything that is mentioned on webdriver.io getting started page.

Some of my configurations in wdio.conf.js file are as follows:

capabilities: [{
    maxInstances: 5,
    browserName: 'chrome',
    acceptInsecureCerts: true
}],
services: ['chromedriver']

When I run the test using the command "npx wdio run wdio.conf.js" it executes instantly and launches the browser and executes test.

But when I want to run the same test on chrome by using selenium-standalone service, I update my wdio.conf.js as:

capabilities: [{
    maxInstances: 5,
    browserName: 'chrome',
    acceptInsecureCerts: true
}],
services: ['selenium-standalone']

It takes good amount of time before it launches the browser and every time it executes the test I have to manually kill Java.exe process because otherwise if I run the test again without killing java process, it will throw error that port 4444 is already in use.

So overall I have two questions:

  1. Why does "Selenium-standalone" service take so long to launch a browser window?
  2. Why does it say 4444 port is already in use if I try to execute test again without killing java process?


Solution 1:[1]

For the second question, there seems to be an open issue in selenium standalone. https://github.com/webdriverio/selenium-standalone/issues/599

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pritam Singh