Facing issues running example scripts on Ubuntu 15.04.

50 views
Skip to first unread message

sow...@gmail.com

unread,
Sep 4, 2015, 6:28:53 AM9/4/15
to phantomjs
Hi!

I am a complete newbie as far as PhantomJS is concerned and no prior experience with using PhantomJS. I built PhantomJS 2.0.1-development from source code on Ubuntu 15.04 and was trying to run the examples/hello.js. The system I am running is Ubuntu 15.04 VM with apache webserver running and direct access to internet (proxyless).

In my first attempt I did not get any output so tried to specify --debug option. Here is my run log:
root@89fd1a2b3771:~/phantomjs/examples# phantomjs --debug=true hello.js
2015-09-04T09:22:49 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=<filename>' to enable persistent cookie storage)
2015-09-04T09:22:49 [DEBUG] Set  "http"  proxy to:  "" : 1080
2015-09-04T09:22:49 [DEBUG] Phantom - execute: Configuration
2015-09-04T09:22:49 [DEBUG]      0 objectName : ""
2015-09-04T09:22:49 [DEBUG]      1 cookiesFile : ""
2015-09-04T09:22:49 [DEBUG]      2 diskCacheEnabled : "false"
2015-09-04T09:22:49 [DEBUG]      3 maxDiskCacheSize : "-1"
2015-09-04T09:22:49 [DEBUG]      4 ignoreSslErrors : "false"
2015-09-04T09:22:49 [DEBUG]      5 localUrlAccessEnabled : "true"
2015-09-04T09:22:49 [DEBUG]      6 localToRemoteUrlAccessEnabled : "false"
2015-09-04T09:22:49 [DEBUG]      7 outputEncoding : "UTF-8"
2015-09-04T09:22:49 [DEBUG]      8 proxyType : "http"
2015-09-04T09:22:49 [DEBUG]      9 proxy : ":1080"
2015-09-04T09:22:49 [DEBUG]      10 proxyAuth : ":"
2015-09-04T09:22:49 [DEBUG]      11 scriptEncoding : "UTF-8"
2015-09-04T09:22:49 [DEBUG]      12 webSecurityEnabled : "true"
2015-09-04T09:22:49 [DEBUG]      13 offlineStoragePath : ""
2015-09-04T09:22:49 [DEBUG]      14 offlineStorageDefaultQuota : "-1"
2015-09-04T09:22:49 [DEBUG]      15 printDebugMessages : "true"
2015-09-04T09:22:49 [DEBUG]      16 javascriptCanOpenWindows : "true"
2015-09-04T09:22:49 [DEBUG]      17 javascriptCanCloseWindows : "true"
2015-09-04T09:22:49 [DEBUG]      18 sslProtocol : "default"
2015-09-04T09:22:49 [DEBUG]      19 sslCiphers : "ECDHE-ECDSA-AES128-GCM-SHA256:                                                                                        -AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-                                                                                        ES128-SHA:AES256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5"
2015-09-04T09:22:49 [DEBUG]      20 sslCertificatesPath : ""
2015-09-04T09:22:49 [DEBUG]      21 webdriver : ":"
2015-09-04T09:22:49 [DEBUG]      22 webdriverLogFile : ""
2015-09-04T09:22:49 [DEBUG]      23 webdriverLogLevel : "INFO"
2015-09-04T09:22:49 [DEBUG]      24 webdriverSeleniumGridHub : ""
2015-09-04T09:22:49 [DEBUG] Phantom - execute: Script & Arguments
2015-09-04T09:22:49 [DEBUG]      script: "hello.js"
2015-09-04T09:22:49 [DEBUG] Phantom - execute: Starting normal mode
2015-09-04T09:22:49 [DEBUG] WebPage - setupFrame ""

I thought it could be a problem with my proxy setting (I have no proxy), so tried to specify that using --proxy-type option. Here is my run log:
root@89fd1a2b3771:~/phantomjs/examples# phantomjs --debug=true --proxy-type=none hello.js
2015-09-04T10:15:36 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=<filename>' to enable persistent cookie storage)
2015-09-04T10:15:36 [DEBUG] Phantom - execute: Configuration
2015-09-04T10:15:36 [DEBUG]      0 objectName : ""
2015-09-04T10:15:36 [DEBUG]      1 cookiesFile : ""
2015-09-04T10:15:36 [DEBUG]      2 diskCacheEnabled : "false"
2015-09-04T10:15:36 [DEBUG]      3 maxDiskCacheSize : "-1"
2015-09-04T10:15:36 [DEBUG]      4 ignoreSslErrors : "false"
2015-09-04T10:15:36 [DEBUG]      5 localUrlAccessEnabled : "true"
2015-09-04T10:15:36 [DEBUG]      6 localToRemoteUrlAccessEnabled : "false"
2015-09-04T10:15:36 [DEBUG]      7 outputEncoding : "UTF-8"
2015-09-04T10:15:36 [DEBUG]      8 proxyType : "none"
2015-09-04T10:15:36 [DEBUG]      9 proxy : ":1080"
2015-09-04T10:15:36 [DEBUG]      10 proxyAuth : ":"
2015-09-04T10:15:36 [DEBUG]      11 scriptEncoding : "UTF-8"
2015-09-04T10:15:36 [DEBUG]      12 webSecurityEnabled : "true"
2015-09-04T10:15:36 [DEBUG]      13 offlineStoragePath : ""
2015-09-04T10:15:36 [DEBUG]      14 offlineStorageDefaultQuota : "-1"
2015-09-04T10:15:36 [DEBUG]      15 printDebugMessages : "true"
2015-09-04T10:15:36 [DEBUG]      16 javascriptCanOpenWindows : "true"
2015-09-04T10:15:36 [DEBUG]      17 javascriptCanCloseWindows : "true"
2015-09-04T10:15:36 [DEBUG]      18 sslProtocol : "default"
2015-09-04T10:15:36 [DEBUG]      19 sslCiphers : "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5"
2015-09-04T10:15:36 [DEBUG]      20 sslCertificatesPath : ""
2015-09-04T10:15:36 [DEBUG]      21 webdriver : ":"
2015-09-04T10:15:36 [DEBUG]      22 webdriverLogFile : ""
2015-09-04T10:15:36 [DEBUG]      23 webdriverLogLevel : "INFO"
2015-09-04T10:15:36 [DEBUG]      24 webdriverSeleniumGridHub : ""
2015-09-04T10:15:36 [DEBUG] Phantom - execute: Script & Arguments
2015-09-04T10:15:36 [DEBUG]      script: "hello.js"
2015-09-04T10:15:36 [DEBUG] Phantom - execute: Starting normal mode
2015-09-04T10:15:36 [DEBUG] WebPage - setupFrame ""

Despite this, I am unable to get anything out of it and I am utterly clueless about what's going on. Tried to search Net but most of the tutorials stop at "phantomjs --version" step. I would highly appreciate if somebody could advise me about how to proceed and/or what could be wrong.

Thanks,
Atul.

sow...@gmail.com

unread,
Sep 10, 2015, 6:29:50 AM9/10/15
to phantomjs
Hi!

I am still searching (without avail) for information on this issue. Help of any kind highly appreciated!

Thanks,
Atul.

Ariya Hidayat

unread,
Sep 11, 2015, 1:53:27 AM9/11/15
to phan...@googlegroups.com
What is the content of your hello.js?
> --
> You received this message because you are subscribed to the Google Groups
> "phantomjs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phantomjs+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phantomjs.
> For more options, visit https://groups.google.com/d/optout.



--
Ariya Hidayat, http://ariya.ofilabs.com

Atul Sowani

unread,
Sep 11, 2015, 5:55:22 AM9/11/15
to phan...@googlegroups.com
It contains following code:

console.log('Hello, world!');
phantom.exit();

It is the standard file that comes in "examples" directory of the source code.

Thanks,
Atul.
> You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/506RKDD785Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.

sow...@gmail.com

unread,
Sep 18, 2015, 3:54:44 AM9/18/15
to phantomjs
I am wondering if "webdriver" value needs to be set - meaning if it is mandatory. Also, is it a must to have a webserver (e.g. apache2) configured and running on the machine where phantomjs is being tested?

Thanks,
Atul.
>> Visit this group at http://groups.google.com/group/phantomjs.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Ariya Hidayat, http://ariya.ofilabs.com
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/506RKDD785Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to phantomjs+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages