Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
88
rated 0 times [  95] [ 7]  / answers: 1 / hits: 5296  / 5 Years ago, wed, july 24, 2019, 12:00:00

I need to change the port number of which selenium standalone server is using by default (4444). Port 4444 is currently in use, is there a way to alter the port number via the wdio file?



// Test runner services
// Services take over a specific job you don't want to take care of. They enhance
// your test setup with almost no effort. Unlike plugins, they don't add new
// commands. Instead, they hook themselves up into the test process.
services: ['selenium-standalone'],


Currently I'm starting selenium server via the following command:



./node_modules/.bin/selenium-standalone start


I have also attempting to use the following with no luck:



./node_modules/.bin/selenium-standalone start -port 7777


Running the above command still attempt to run selenium sever on port 4444.


More From » selenium

 Answers
4

To run the selenium-standalone on the specific port you should use the following syntax:



./node_modules/.bin/selenium-standalone start -- -port 7777


Change the port in the wdi.conf.js:



seleniumArgs: {
seleniumArgs: [-port, 7777],
},


Also, read more about the wdio configuration file here and about wdio-cli here



So, your final wdio.conf.js should look like:



exports.config = {
/**
* server configurations
*/
services: ['selenium-standalone'],
port: 7777,
seleniumArgs: {
seleniumArgs: [-port, 7777],
},
}

[#6813] Monday, July 22, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mckaylab

Total Points: 311
Total Questions: 120
Total Answers: 93

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
;