Running PhantomJS within Selenium Grid (ie, remotely)

瀏覽次數:4,425 次
跳到第一則未讀訊息

Robert

未讀,
2013年12月31日 下午4:12:552013/12/31
收件者:webd...@googlegroups.com
I was just wondering if anyone within this group has had success in setting up PhantomJS to run within a Selenium grid.  I've been able to successfully setup PhantomJS to run locally, but I'm struggling on getting it to run remotely.  If anyone has experience with this they'd like to share or could point me to some documentation related to this, I sure would appreciate it.

susanth.nair

未讀,
2013年12月31日 晚上10:12:172013/12/31
收件者:webd...@googlegroups.com

register phantomjs to hub

"/path/phantomjs.exe --webdriver=5567--webdriver-selenium-grid-hub=http://127.0.0.1:4444"  - donot use host name , or "localhost" , use only IP

use same verison of jars for hub and node machines ( EX: 2.37)

then use

WebDriver driver = new RemoteWebDriver("http://IP of the node machine:5567/wd/hub",DesiredCapabilities.phantomjs());


thanks

Susanth B










On Wed, Jan 1, 2014 at 2:42 AM, Robert <rest...@gmail.com> wrote:
I was just wondering if anyone within this group has had success in setting up PhantomJS to run within a Selenium grid.  I've been able to successfully setup PhantomJS to run locally, but I'm struggling on getting it to run remotely.  If anyone has experience with this they'd like to share or could point me to some documentation related to this, I sure would appreciate it.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.

Robert

未讀,
2014年1月2日 凌晨4:53:492014/1/2
收件者:webd...@googlegroups.com
Thanks, I'll give this a try.

Praneel Redlapalle

未讀,
2014年3月24日 晚上7:18:342014/3/24
收件者:webd...@googlegroups.com
Dear Susanth,

In your example, I assume that you are running both node & hub on the same host. Is it feasible to run them on different hosts?

Thanks,
praneel

Krishnan Mahadevan

未讀,
2014年3月24日 晚上9:22:142014/3/24
收件者:webd...@googlegroups.com
To the best of my knowledge that is the real use case for the grid setup. So yes PhantomJS should be able to run in that mode [ it and hub run on different machines ] as long as there is network connectivity and no port blockages. 

iSent. iPhone. iReget. iThumbs.iTypos!
For more options, visit https://groups.google.com/d/optout.

Praneel

未讀,
2014年3月25日 凌晨1:25:292014/3/25
收件者:webd...@googlegroups.com
Dear Krishnan, thanks for your response.
I am able to get the communication going well b/w the hub & node using Firefox. But the same does not work when I use PhantomJS. Even my assumptions are the same. What works with browsers should seamlessly work with headless ones too.

The node config shows as below in the grid - 

port:9301

timeout=60:

registerCycle:5000

newSessionWaitTimeout:-1

hub:http://54.184.118.46:4444/

prioritizer:null

remoteHost:http://127.0.0.1:9301

browserTimeout=60:

throwOnCapabilityNotPresent:true

proxy:org.openqa.grid.selenium.proxy.DefaultRemoteProxy

dms256m:

maxSession:1

role:wd

servlets:[]

host:null

cleanUpCycle:5000

browserTimeout:0

hubHost:54.184.118.46

capabilityMatcher:org.openqa.grid.internal.utils.DefaultCapabilityMatcher

newSessionWaitTimeout=60000:

url:http://127.0.0.1:9301

register:true

Xmx2048m:

nodePolling:5000

hubPort:4444

timeout:300000


As seen in the config, remote host is being defaulted to localhost. But my remote host IP is 54.185.213.221.
There should certainly be a mechanism wherein i can override the remote host IP.

Thanks,
Praneel

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

Praneel

未讀,
2014年3月25日 凌晨1:32:552014/3/25
收件者:webd...@googlegroups.com
Initially the connection does get established but drops shortly.

tcp        0      0 0.0.0.0:9301            0.0.0.0:*               LISTEN      8593/phantomjs
tcp        0      0 10.234.77.249:49477     54.184.118.46:4444      ESTABLISHED 8593/phantomjs  

After a few seconds, I only see this - 

tcp        0      0 0.0.0.0:9301            0.0.0.0:*               LISTEN      8593/phantomjs 

Thanks,
Praneel

Krishnan Mahadevan

未讀,
2014年3月25日 凌晨4:34:562014/3/25
收件者:webdriver
Can you please share the command you are using to register your PhantomJS node to a remote hub ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Praneel

未讀,
2014年3月31日 晚上10:00:352014/3/31
收件者:webd...@googlegroups.com
Hi Krishnan, Thanks for your response & sorry for my delayed reply. I basically got it to work by passing in the complete IP of my local node.
i.e. Earlier I would run - 
sudo /tmp/phantomjs-1.9.7-linux-x86_64/bin/phantomjs --webdriver-selenium-grid-hub=<Remote_IP>:4444 -webdriver=9301

Running by providing my complete IP address instead of just the port solved the issue  - 
sudo /tmp/phantomjs-1.9.7-linux-x86_64/bin/phantomjs --webdriver-selenium-grid-hub=<Remote_IP>:4444 -webdriver=<local_IP>:9301

Thanks,
praneel

nek...@tibco.com

未讀,
2016年2月8日 中午12:06:412016/2/8
收件者:webdriver
Hi Sushant.Thank you for the answer but it is not working for me. I am getting the following error :

[INFO  - 2016-02-08T11:44:25.712Z] GhostDriver - Main - running on port 5567
[INFO  - 2016-02-08T11:44:25.715Z] GhostDriver - Main - registering to Selenium
HUB 'http://10.97.122.88:4444' version:  using '10.97.122.88:5567' with org.ope
qa.grid.selenium.proxy.DefaultRemoteProxy as remote proxy.
[ERROR - 2016-02-08T11:44:25.732Z] GhostDriver - main.fail - {"line":97,"source
RL":"phantomjs://platform/hub_register.js","stack":"register@phantomjs://platfo
m/hub_register.js:97:79\nglobal code@phantomjs://code/main.js:78:37"}

  phantomjs://platform/console++.js:263 in error


Arpana Kumari

未讀,
2016年9月14日 晚上7:20:522016/9/14
收件者:webdriver
Hi All,

I am unable to run phanomJSDriver in gris, getting error:

 phantomjs://platform/console++.js:263 in error

can anyone help me,

Arpana Kumari

未讀,
2016年9月14日 晚上7:21:092016/9/14
收件者:webdriver
getting error  phantomjs://platform/console++.js:263 in error while 

⇜Krishnan Mahadevan⇝

未讀,
2016年9月17日 上午11:55:392016/9/17
收件者:webdriver

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.

To post to this group, send email to webd...@googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息