Im利用Selenium实现客户服务器的浏览器自动化,但我希望服务器在启动时自动执行ium。
我有3份档案,载于:
proxyserver.conf:
respawn
start on runlevel [23]
script
exec java -jar selenium-server-standalone-2.20.0.jar -role hub -port 1111
end script
proxyserver2.conf and proxyserver3.conf that are the same what and change only the content of “script”:
exec java -Dwebdriver.chrome.driver=/home/marco/selenium-client/chromedriver -jar selenium-server-standalone-2.20.0.jar -role node -port 2222 -hub http://192.168.1.12:1111 -browserName=chrome,maxInstances=5
如果在开始采用这一方法时我执行这一指令,那么当我对客户进行消费时,我就会发现这一错误:
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
但是,如果我是在终点站执行我使用的同一指挥,那么所有指挥都完美地工作......为什么!
最后一点,如果我执行的话:
ps aux | grep selenium
当服务器开张时,给我:
root 746 0.0 12.1 677080 124468 ? Ssl Apr23 8:10 java -Dwebdriver...
root 749 0.0 12.7 685552 130280 ? Ssl Apr23 8.09 java -Dwebdriver...
root 755 0.0 1.9 680168 20240 ? Ssl Apr23 8.08 java -jar selenium...
当我在终点站执行时,它给我:
1000 9764 6.6 3.0 679236 30992 pts/0 Sl+ 10.33 0:01 java -jar...
1000 9783 14.0 3.0 677112 31752 pts/1 Sl+ 10.33 0:01 java -Dwebdriver...
1000 9792 12.6 3.0 675472 30944 pts/2 Sl+ 10.34 0:01 java -Dwebdriver...
Why it can t works?
感谢!