English 中文(简体)
启动时的消费
原标题:Execute Selenium at the startup

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?

感谢!

问题回答

我看到了这种错误,当时ch越了越权的道路是错误的。 如果你看见驻地协调员会议,那么它就应该有被抽取的乘人没有发现错误的信息。

草原环境财产应当作为参数通过,以备len。

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

应当改为

exec java -jar selenium-server-standalone-2.20.0.jar -role node -port 2222 -hub http://192.168.1.12:1111 -browserName=chrome,maxInstances=5 -Dwebdriver.chrome.driver=/home/marco/selenium-client/chromedriver




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签