Skip to content

Commit 1eb3d09

Browse files
vtangejleyba
authored andcommitted
Add 'How to build driver with phantomjs-prebuilt' (#2086)
1 parent 8981d76 commit 1eb3d09

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

javascript/node/selenium-webdriver/phantomjs.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
/**
19+
* @fileoverview Defines a {@linkplain Driver WebDriver} client for the PhantomJS
20+
* web browser. By default, it is expected that the PhantomJS executable can be located on your [PATH](https://en.wikipedia.org/wiki/PATH_(variable))
21+
*
22+
* __Using a Custom PhantomJS Binary__
23+
*
24+
* If you have PhantomJS.exe placed somewhere other than the root of your working directory,
25+
* you can build a custom Capability and attach the executable's location to the Capability
26+
*
27+
* For example, if you're using the [phantomjs-prebuilt](https://www.npmjs.com/package/phantomjs-prebuilt) module from npm:
28+
*
29+
* //setup custom phantomJS capability
30+
* var phantomjs_exe = require('phantomjs-prebuilt').path;
31+
* var customPhantom = selenium.Capabilities.phantomjs();
32+
* customPhantom.set("phantomjs.binary.path", phantomjs_exe);
33+
* //build custom phantomJS driver
34+
* var driver = new selenium.Builder().
35+
* withCapabilities(customPhantom).
36+
* build();
37+
*
38+
*/
39+
1840
'use strict';
1941

2042
const fs = require('fs');

0 commit comments

Comments
 (0)