Pages

Monday, April 2, 2012

Browser not shown while executing Selenium tests in Hudson

While executing the Selenium tests in Hudson, you might have noticed following:

1) Browser window is not shown
2) Execution is halted while performing an action like a click event
3) Execution halts due to unexpected pop-ups which needs user interaction

The solution for this is to launch the Hudson Slave in console mode i.e.. from command prompt.

Here are the steps:

SOLUTION1:

1) Stop Hudson Slave service
2) Change the Hudson Slave service to Manual
3) Restart the machine
4) From Command prompt, go to hudson home directory and execute following command

java.exe -Xrs -jar "slave.jar" -tcp port.txt

SOLUTION2:

Launch the slave as JNLP slave:

1) Go to the slave machine.
2) Execute following command:
java -jar slave.jar -jnlpUrl http://&lt;<url_to_master>&gt;/computer/&lt;<name_of_slave>&gt;/slave-agent.jnlp
ex: java -jar slave.jar -jnlpUrl http://machine1:8080/computer/machine1/slave-agent.jnlp

restorecon command: fixes the corrupted files in linux

SOme times some files may get corrupted and may shows errors as shown below: Cannot load /etc/httpd/modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: failed to map segment from shared object: Permission denied The only and easiest way to solve this problem is to use the restorecon command Ex: [root@mulmu01-VM6783 httpd]# apachectl start Syntax error on line 4 of /etc/httpd/conf.d/tomcat.conf: Cannot load /etc/httpd/modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: failed to map segment from shared object: Permission denied [root@mulmu01-VM6783 httpd]# restorecon -v /etc/httpd/modules/mod_jk.so restorecon reset context /usr/lib/httpd/modules/mod_jk.so:root:object_r:usr_t->system_u:object_r:httpd_modules_t [root@mulmu01-VM6783 httpd]# apachectl start [root@mulmu01-VM6783 httpd]#