Selenium Grid - remote control connections to hub - fail to register, but build successfully - selenium

I've successfully run a Selenium Grid on my local machine, and I've moved it to a server (windows Server 2008 R2).
The server instance has run successfully with locally launched agents
The server hosted console is visible over the internet
However, when I create a new remote control on a different machine, they build successfully but they do not register with the hub.
The command line is:
ant -Dport=6601 -Dhost=<ip address of my box> -DhubURL=http://ab.cdefg.ca:4444/wd/hub* -Denvironment"firefox" launch-remote-control
I've also used my hostname as a replacement for my ip name (pc78.subdomain.domain.ca)
If I do not specify the Denvironment, I get the following back:
C:\Sgrid\selenium-grid-1.0.8>ant -Dport=6601 -Dhost=pcname.subdomain.domain.ca -Dhu
bURL=http://ab.cdefg.ca:4444/wd/hub* launch-remote-control
Buildfile: C:\Sgrid\selenium-grid-1.0.8\build.xml
launch-remote-control:
[java] Sep 15, 2011 3:37:11 PM com.thoughtworks.selenium.grid.remotecontrol
.RegistrationRequest execute
[java] INFO: Registering to http://ab.cdefg.ca.ca:4444/wd/hub*/registration
-manager/register
[java] Exception in thread "main" java.lang.IllegalStateException: Could no
t register successfuly to http://ab.cdefg.ca.ca:4444/wd/hub*/registration-manage
r/register with environment '*firefox'. Most likely this environment is not defi
ned on the hub.
[java] at com.thoughtworks.selenium.grid.remotecontrol.RegistrationRequ
est.execute(RegistrationRequest.java:29)
[java] at com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringR
emoteControl.register(SelfRegisteringRemoteControl.java:29)
[java] at com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringR
emoteControlLauncher.main(SelfRegisteringRemoteControlLauncher.java:27)
BUILD FAILED
C:\Sgrid\selenium-grid-1.0.8\build.xml:90: Java returned: 1
Total time: 1 second
If do specify the Denvironment, I get the following back:
C:\Sgrid\selenium-grid-1.0.8>ant -Dport=6601 -Dhost=pcname.sub.domain.ca -Dhu
bURL=http://ab.cdefg.ca:4444 -Denvironment"firefox" launch-remote-control
Buildfile: C:\Sgrid\selenium-grid-1.0.8\build.xml
BUILD SUCCESSFUL
Total time: 0 seconds
C:\Sgrid\selenium-grid-1.0.8>
However, the console does not recognize or utilize this agent. Nor is this agent visible on http://localhost:4444/console
So I thought, I'll reverse it and use my local as a server and try and register the server as a remote control, but the same problem repeated itself, command line success, but functionally no activity. Sounds like a network problem, so I booted up a third machine, installed and tested selenium grid (works). Console is visible from my laptop, running on my desktop, via ipaddress:4444/console.
I then launched a remote control, had the same problem. Okay, I then turn off the firewall on my local desktop (treating it as my server) and my laptop (treating it as a remote). Same problem.
Finally, thinking maybe the existence of a local console is messing with the remote launch, I reboot and run only the following:
ant -Dport=6601 -Dhost=<laptop ip> -DhubURL=http://<desktop ip>:4444 -Denvironment"firefox" launch-remote-control
Same problem.
Also I can ping the server from my desktop
Is there a setting I'm missing? It seems like everything in each instance is okay, and all of them have the same versions installed. Clearly something isn't getting from one place to the other, but I have no idea how to work around it when everything else seems okay. Many thanks.

You need an "=" after the environment. I.e., -Denvironment="firefox".

ant -Dport=6666 -Dhost=pc78.subdomain.domain.ca -DhubURL=http://ab.cdef.ca:4444 launch-remote-control
Thanks for the kick start - dropping the "/wd/hub*" from the DhubURL and dropping the Denvironment all together actually got me working - thanks for the response. I

Related

Azure container instance behave differently that local container

I have a strange situation that i would like to share with you.
I started container recently and wand to have Azure DevOps agent running on container.
On my windows 10 laptop , i can instanciate a Linux container and
everything run & execute well (using WSL)
On a Ubuntu VM running an Azure, the same container run well and
execute well
However the same container in Azure Container instance failed and for unknow reason i get the following error:
Generating browser application bundles (phase: setup)...
/bin/sh: 1: wslpath: not found
01 12 2022 14:55:59.933:ERROR [config]: Error in config file!
Error: Command failed: wslpath -w "/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin"
/bin/sh: 1: wslpath: not found
When i see wsl i think about Windows Subsystem Linux but i am not sure. I really do not understand why ACI behave like that with that error.
I always thought that container should behave the same wherever it runs. Did you experience it ? Any idea are welcome.
Regards

Test Cases of Robot Framework are getting failed on server giving error "TypeError: get_request() got an unexpected keyword argument"

I have a project in Java and the test scripts are written in robot.
I want to run my test scripts on the server where I have a WAR file, (after building), of my project. When I am running my test scripts on the local system it working, but When I run my test scripts on server, some tests are getting passed and some are getting failed. My server is Ubuntu 14.04.
I am using the following command to run test scripts on server:
pybot -v env:dev /var/lib/jenkins/jobs/AnATest/tests/
where env:dev is just environment name and /var/lib/jenkins/jobs/AnATest/tests/
is my directory where all my robot tests files are residing.
Please tell me, if more information is required.
It sounds like you simply have a different version of a library on your server than on your local machine. The one on the server has a get request keyword that doesn't take the same arguments as the one on your local machine.

Unable to start Active MQ on Linux

I am trying to get ActiveMQ server running on a RaspberryPI Debian Squeeze box and all appears to be installed correctly but when I try and start the service I am getting the following...
root#raspberrypi:/var/www/activemq/apache-activemq-5.7.0# bin/activemq
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/jre1.7.0_07/bin/java'
/usr/jre1.7.0_07/bin/java: 1: /usr/jre1.7.0_07/bin/java:ELF0
4°: not found
/usr/jre1.7.0_07/bin/java: 2: /usr/jre1.7.0_07/bin/java: Syntax error: "(" unexpected
Tasks provided by the sysv init script:
restart - stop running instance (if there is one), start new instance
console - start broker in foreground, useful for debugging purposes
status - check if activemq process is running
setup - create the specified configuration file for this init script
(see next usage section)
Configuration of this script:
The configuration of this script can be placed on /etc/default/activemq or /root/.activemqrc.
To use additional configurations for running multiple instances on the same operating system
rename or symlink script to a name matching to activemq-instance-<INSTANCENAME>.
This changes the configuration location to /etc/default/activemq-instance-<INSTANCENAME> and
$HOME/.activemqrc-instance-<INSTANCENAME>. Configuration files in /etc have higher precedence.
root#raspberrypi:/var/www/activemq/apache-activemq-5.7.0#
It looks like there is an error somewhere but I am a fairly newbie at this and don't know where to look.
Just adding an answer since,becoz as per the documentation , the command is wrong
to start activemqm, use
Navigate to [installation directory/bin] and run ./activemq start or simple bin/activemq start
if you want to see it live in a window use bin/activemq console
To stop, you have to kill the process
The default ActiveMQ "getting started" link sends u here : http://activemq.apache.org/getting-started.html which is the "Getting Started Guide for ActiveMQ 4.x".
If you scroll down main documentation page, you will find this link with the proper commands :
http://activemq.apache.org/version-5-getting-started.html

Jenkins stops at Launching Internet Explorer

we are using Jenkins as CI in our project. We were running the CI from the command line using the following command
java -jar C:\\jenkins\\jenkins.war --httpPort=8085 --ajp13Port=8009
As the system needs to restart frequently, we change CI to start as a windows service.
Now we are facing the issues for Selenium test cases. Selenium test cases are not running after we make Jenkins as service. We are getting the following log and no more progress from that point
18:36:30,718 INFO [org.openqa.selenium.server.SeleniumDriverResourceHandler] Command request: getNewBrowserSession[*iexploreproxy, http://192.168.132.105:8080/, ] on session null
18:36:30,718 INFO [org.openqa.selenium.server.BrowserSessionFactory] creating new remote session
18:36:30,796 INFO [org.openqa.selenium.server.BrowserSessionFactory] Allocated session 80b95d0273ac4ea4a82860c79438f071 for http://192.168.132.105:8080/, launching...
18:36:30,796 INFO [org.openqa.selenium.server.browserlaunchers.WindowsProxyManager] Modifying registry settings...
18:36:31,781 INFO [org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher] Launching Internet Explorer...
Per hudson wiki, you should be running Hudson (or jenkins) as tasks rather than service for GUI testing. Check here. Look at the section GUI Testing in Windows
Following changes will resolve the problem
Update the selenium version.
Use *iexploreproxy or *piiexplore for IE instead of *iehta/*iexplore

Tomcat will not start after deploying sakai from source

I've followed the instructions in this URL: http://pmungai.wordpress.com/sakai-developer-guide/sakai-linux-cheatsheet/ and was able to compile and deploy sakai, however, after restarting tomcat, it will show me this:
root#ip-10-72-129-39:/opt/sakai# sh /opt/tomcat/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-1.6.0-openjdk-amd64
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar
meaning that tomcat started successfully, but when I try to open the url from a browser, it simply loads forever, waiting for a response. If I try to shutdown tomcat, I get:
root#ip-10-72-129-39:/opt/sakai# sh /opt/tomcat/bin/shutdown.sh
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-1.6.0-openjdk-amd64
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar
2012-05-24 15:26:34,357 ERROR main org.apache.catalina.startup.Catalina - Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at java.net.Socket.<init>(Socket.java:392)
at java.net.Socket.<init>(Socket.java:206)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)
Which happens when tomcat wasn't running to begin with.
I was able to test that tomcat was running exactly before deploying sakai, and right after, it wasn't able to load a web page.
Does anyone know what is going on?
Before starting a sakai development environment i'd sugges trying the sakai 2.8.x demo, it will provide an internal database and have some most of the standard functionalities.
You should download the demo project from:
https://testdrivesakai.com/portal
After you get used to the flows, configurations etc. you should set up your own instance with your own sakai schema. But when you do so also make sure you have at least some minimum hardware settings available and also the following tomcat startup arguments in place:
-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m
-XX:NewSize=192m
-XX:MaxNewSize=384m
-Djava.awt.headless=true
-Dhttp.agent=Sakai
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
-Dsun.lang.ClassLoader.allowArraySyntax=true
Also make sure you join the sakai-dev mailing list as you will get faster support by posting problems there.
The link to join the sakai dev-list:
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
In my experience this is usually database related. Are you using the out-of-the-box hsqldb or MySQL? After compiling and deploying with Maven into your tomcat directory when you first startup Tomcat it has to auto-create a bunch of tables. In many cases this can fail for a few reasons.
I will assume you are using MySQL as hsqldb has very few issues:
Sometimes the initial tomcat launch can shutdown your mysqlservice and not allow it to start back up again. This is usually due to it being unable to create error log files in the locations specified in your my.cnf file. Try commenting out any instances where these logs are being used and restart the service. Then retry the launch.
On Linux use "# ./catalina.sh run" instead of invoking the startup shell script. This will spawn a 2nd terminal window and show you everything that's happening (including any errors) while Tomcat is attempting to launch.
See if any tables were made in your database. If not then its a database connection issue. If so you should have around 377 tables or so depending on the Sakai version.
If you are getting "cache is not alive" errors in your tomcat logs this is a known race condition. You may need to disable the table auto-creation (assuming the tables have already been made from previous launch trials) and apply the patch outlined here:
KNL-1290
Without having error messages to work with it's difficult to diagnose your problem.