Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 37e0f1a

Browse files
committed
feat(install selenium): better communication in the install script
Adds better messages in the selenium server install script, and also makes the script output a 'start' executable which can be used to quickly start up the selenium standalone. *not yet windows friendly*. Closes #108.
1 parent b32f5a5 commit 37e0f1a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A script is included to do the download for you - run (add the --nocd option if
117117

118118
Start the selenium standalone with
119119

120-
java -jar selenium/selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=./selenium/chromedriver
120+
./selenium/start
121121

122122
For alternate ways to download and start the selenium standalone, see
123123
[the webdriver docs](http://docs.seleniumhq.org/docs/03_webdriver.jsp#running-standalone-selenium-server-for-use-with-remotedrivers).

bin/install_selenium_standalone

+14
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@ var CHROMEDRIVER_URL_WINDOWS =
2222
'https://chromedriver.googlecode.com/files/chromedriver_win32_2.2.zip';
2323

2424
var DOWNLOAD_DIR = './selenium/';
25+
var START_SCRIPT_FILENAME = DOWNLOAD_DIR + 'start';
2526
var chromedriver_url = '';
27+
var start_script = 'java -jar selenium/selenium-server-standalone-2.35.0.jar';
28+
2629

2730
if (!fs.existsSync(DOWNLOAD_DIR) || !fs.statSync(DOWNLOAD_DIR).isDirectory()) {
2831
fs.mkdirSync(DOWNLOAD_DIR);
2932
}
3033

34+
console.log(
35+
'When finished, start the Selenium Standalone Server with ./selenium/start \n');
36+
3137
// Function to download file using HTTP.get
3238
var download_file_httpget = function(file_url, callback) {
39+
console.log('downloading ' + file_url + '...');
3340
var options = {
3441
host: url.parse(file_url).host,
3542
port: 80,
@@ -70,6 +77,7 @@ if (!(process.argv[2] == '--nocd')) {
7077
}
7178

7279
var chromedriver_zip = chromedriver_url.split('/').pop();
80+
start_script += ' -Dwebdriver.chrome.driver=./selenium/chromedriver';
7381

7482
download_file_httpget(chromedriver_url, function(file_name) {
7583
var zip = new AdmZip(file_name);
@@ -79,3 +87,9 @@ if (!(process.argv[2] == '--nocd')) {
7987
}
8088
});
8189
}
90+
91+
var start_script_file = fs.createWriteStream(START_SCRIPT_FILENAME);
92+
start_script_file.write(start_script);
93+
start_script_file.end(function() {
94+
fs.chmod(START_SCRIPT_FILENAME, 0755);
95+
});

docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ the standalone server. Run
4040
This installs selenium standalone server and chromedriver to `./selenium`. Start
4141
the server with
4242

43-
java -jar selenium/selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=./selenium/chromedriver
43+
./selenium/start
4444

4545
Protractor is now available as a command line program which takes one argument,
4646
a configuration file.

0 commit comments

Comments
 (0)