0
我使用Selenium從客戶端自動化服務器中的瀏覽器,但我希望服務器在啓動時自動執行硒。在啓動時執行Selenium
我在/ etc /初始化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和proxyserver3.conf是同樣的事情,唯一的改變「腳本」的內容:
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.
但如果我執行的終端,我在/ etc使用相同的命令/初始化,所有的作品完美...爲什麼?
最後一件事,如果我執行:
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...
爲什麼它不能正常工作?
謝謝!!