Having trouble launching Google Chrome through Selenium RC server on Ubuntu - google-chrome

I'm running Selenium RC server 2.0b3 on Ubuntu 11.04. I installed Google Chrome and am trying to run some tests against it. I'm able to run tests against Firefox just fine. However, when I run my test against the Selenium server, it just hangs and then times out. This is all the server log reports (notice the null session):
16:14:16.810 INFO - Command request: getNewBrowserSession[*googlechrome, http://mydomain.com, ] on session null
16:14:16.810 INFO - creating new remote session
16:14:16.811 INFO - Allocated session 6913c9613c554db798e109eadefd43da for http://mydomain.com, launching...
16:14:16.811 INFO - Launching Google Chrome...
16:19:44.776 ERROR - Failed to start new browser session, shutdown browser and clear all session data
org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:564)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:521)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:374)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
16:19:44.777 INFO - Killing Google Chrome...
16:19:44.777 INFO - Got result: Failed to start new browser session: Error while launching browser on session null
I am starting Selenium as a service on system startup, like so ...
start() {
log_daemon_msg "Starting selenium-server server: "
/usr/bin/Xvfb :15 -ac -screen 0 1024x768x8 &
export DISPLAY=localhost:15.0
su selenium -c 'java -jar /opt/selenium/selenium-server-standalone-2.0b3.jar -userExtensions /opt/selenium/user-extensions.js > /var/log/se_rc_server.log 2>&1 &'
PID=$!
### Create the lock file ###
echo $PID > /var/run/selenium-server.pid
echo
Any ideas how I can eliminate the Google Chrome null sessions and get my tests to run? Thanks, - Dave

You're running into Chrome's security restrictions. You need to set the "mode" value to "disableSecurity" in your BrowserConfigurationOptions to disable them.

Related

Can't run unit tests in Bluemix Build & Deploy Pipeline because the servers can't connect to ClearDB MySQL

SOLVED!
Looks like the pipeline service in Bluemix has been updated, the connection to ClearDB works beautifully now! Thanks to whoever pushed that change! :)
--
I am running the code within the Bluemix build & Deploy pipeline, NOT inside the Liberty Profile app server (the application works fine there), the problem lies on the BUILD Stage of the Pipeline (mvn clean install) while running my Unit Tests, here's the error message
Building new Hibernate SessionFactory 2015-04-11 15:04:49 [main] ERROR
o.h.util.JDBCExceptionReporter - Communications link failure
The last packet sent successfully to the server was 0 milliseconds
ago. The driver has not received any packets from the server.
The Unit Test classes can't connect to the database.
My code doesn't have anything special, you can create any standard JDBC Connection in a JUnit Test class and try to establish connection with the db, but if you want to easily confirm this connectivity limitation, here's how you can test this without any Java code:
Create a Liberty Profile app with some Starter Code
Create and bind the "ClearDB MySQL" service to it
In the App Overview page, expand the ClearDB box by clicking on "Show
Credentials" and copy the hostname (e.g.,
us-cdbr-test-west-07.cleardb.net).
Add GIT, back to the App Overview, click on EDIT CODE, Click on
"Build & Deploy", click on the configuration icon of the "BUILD
Stage", select "Configure Stage" and add the following code to the
command box:
code
REMOTEHOST=us-cdbr-test-west-07.cleardb.net
REMOTEPORT=3306
TIMEOUT=1
if nc -w $TIMEOUT -z $REMOTEHOST $REMOTEPORT; then
echo "I was able to connect to ${REMOTEHOST}:${REMOTEPORT}"
else
echo "Connection to ${REMOTEHOST}:${REMOTEPORT} failed; exit code from netcat was $?"
fi
Start the BUILD Stage and check if this message shows up:
[86d18f86-4ade-4e02-8282-171dc9757272] $ /bin/bash /tmp/hudson5506792757013948518.sh
Connection to us-cdbr-test-west-07.cleardb.net:3306 failed; exit code from netcat was 1
Please let know if there's a way to configure the pipeline so it can communicate with ClearDB.
There has been an update to the pipeline service in Bluemix, which has fixed this bug. Connections to the "ClearDB" service should now be working.

Remote debugging Internjs that runs on selenium chromedriver

I try to remotely debug tests run by Internjs.
Basically it is a Chrome that is run by Selenium and Chromedriver.
I set up Chromedriver debuggerAddress option as
debuggerAddress: '127.0.0.1:8765'
Now when I run tests Selenium waits some time and than fails with message:
FATAL ERROR
UnknownError: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"browserName":"chrome","name":"tests/intern_local","idle-timeout":60,"selenium-version":"2.44.0","chromeOptions":{"debuggerAddress":"127.0.0.1:8765"}}}] unknown error: cannot connect to chrome at 127.0.0.1:8765
from chrome not reachable
(Driver info: chromedriver=2.12.301326 (093c7e07b4a916b690e784b0374c7f618f1ea4be),platform=Mac OS X 10.10.1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.64 seconds
I'm not sure what I have to do so that chrome would connect to server.
I did try:
Running chromedriver on that port ./chromedriver_2.11 --port=8765
Running chrome with --remote-debugging-port=8765
But I have no other ideas how to start a chrome debug server.
Useful links that I did try that that did not work for me:
Remote debugging protocol
Remotely debugging Chrome Desktop
Chromedriver Capabilities (aka ChromeOptions)
Update 1 Forcing Chromedriver to use a Chrome instance with remote debugging on
Run a new Chrome instance as in Mozilla article
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=$(mktemp -d -t 'chrome-remote_data_dir')
In intern set
intern.capabilities = {
'selenium-version': '2.44.0'
, 'chromeOptions': {
debuggerAddress: '127.0.0.1:9222'
}
};
Now when you run Intern tests Intern will use your previously open Chrome instance. Now you can open localhost:9222 and you'll see that you can debug that tab in which tests run. However for me I'm just able to see that remote tab, but clicking on it does nothing.
I also tried Firefox WebIDE. I tried to connect to localhost:9222, it starts to load and after some time it says that it can't connect.
I tried something similar this evening, without using a framework. I opened a webdriver session & added the remote debugger capabilities.
It seems that it is not possible to run a webdriver session & remote debug at the same time. I asked some Google guys to verify that, but haven't received an answer yet.

Sublime Text 2 - There are no packages available for installation

So many Sublime Text 2 users get error (or) no action when they want to install any sublime text 2 package #via Package Control.
When I'm clicked on Package Control: Install Package from Ctrl+Shift+P.
I got this below error:
There are no packages available for installation
Note: Some times error message is not displayed and no action is happened.
When I'm tracing error report from console. I got this below error on console.
Package Control: Trying to execute command /usr/bin/curl --user-agent 'Sublime Package Control v2.0.0' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmpwQjJVT --header 'If-Modified-Since: Sun, 03 Aug 2014 12:10:13 GMT' --cacert /usr/lib/ssl/certs/ca-certificates.crt -v https://sublime.wbond.net/channel.json
Package Control: Curl HTTP Debug General
Hostname was NOT found in DNS cache
Trying 50.116.34.243...
Trying 2600:3c02:e000:42::1...
connect to 2600:3c02:e000:42::1 port 443 failed: Network is unreachable
Failed to connect to sublime.wbond.net port 443: Network is unreachable
Closing connection 0
Package Control: Error downloading channel. curl: (7) Failed to connect to sublime.wbond.net port 443: Network is unreachable downloading https://sublime.wbond.net/channel.json.
error: Package Control
There are no packages available for installation
How to solve this problem?
This error is happened with IPv6 problem. If your Internet Service
Provider (ISP) does not support for IPv6 you will get this error.
How to solve this on Unix (OSX/Linux/Ubuntu/CentOS/etc...):
Open terminal and run this below command line.
sudo echo "50.116.34.243 sublime.wbond.net" >> /etc/hosts
How to solve this on Windows:
Click on start button on your windows desktop and find cmd.
Now right click on Command Prompt option and select Run as administrator.
Run this below command line on CMD.
echo 50.116.34.243 sublime.wbond.net >> "C:\Windows\system32\drivers\etc\hosts"
Do not hard-code the current ip of sublime.wbond.net. This will not solve the problem, and will only break your machine's connection to Package Control in the near future.
If you are having trouble with ipv6, use the latest version from https://github.com/wbond/package_control. It has a fix for curl and wget when they encounter issues with computers that provide ipv6 via DNS, but can not actually access sites via ipv6.
If you are still having trouble with Package Control, follow the instructions at https://packagecontrol.io/docs/issues. Please be sure to include a debug log, otherwise I can't help.
Three stps to solve this problem on Mac in China.
add "0.116.34.243 sublime.wbond.net" into /etc/host
open Global Mode of Shadowsocks (needed only in China)
restart Sublime
I had the same problem today, and after a long search I found out that packagecontrol.io website was down!

Unable to Launch Chrome Browser in Selenium

I am launching chrome browser using
selenium = new DefaultSelenium("localhost", 4444, "*googlechrome",
"https://example.com/");
But i get a popup with following message and it freezes:
An administrator has installed Google Chrome on this system, and it is available for all users. The system-level Google Chrome will replace your user-level installation now.
Console Log till point of freeze:
Server started
16:06:37.792 INFO - Command request: getNewBrowserSession[*googlechrome, https://example.com/, ] on session null
16:06:37.796 INFO - creating new remote session
16:06:38.081 INFO - Allocated session beb925cd0418412dbe6319fedfb28614 for https://example.com/, launching...
16:06:38.082 INFO - Launching Google Chrome...
Any suggestions?
Try giving location of your chrome exe too along with browser name like this :
selenium=new DefaultSelenium("localhost", 4444, "*googlechrome C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "https://example.com");

Starting google-chrome via Selenium on headless debian system

I'm trying to start the google-chrome browser in disabled web security mode. The selenium log says:
15:36:33.526 INFO - Command request: getNewBrowserSession[*googlechrome, http://www.myurl.de, , commandLineFlags=--disable-web-security] on session null
Anyways, it just hangs after
15:36:33.600 INFO - Launching Google Chrome...
Here's the stack trace:
16:36:44.605 ERROR - Failed to start new browser session, shutdown browser and clear all session data org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:564) at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:521) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:374) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Selenium is started by robotframework by the robotframework-maven-plugin. Also xvfb is started by the maven build script to simulate a display. But the startup configuration does not seem to be the problem. Everything starts fine, just the browser won't get up.
I hope anyone can help me.
Make sure that the user account that is launching the browser has a home directory. Otherwise the browser profile creation will fail.