Can't we use 2 different chrome browser using different port? - selenium-chromedriver

I started two chrome using
start chrome --remote-debugging-port=9222
start chrome --remote-debugging-port=9223
I tried connecting to these browsers using rpaframework keyword:
RPA.Browser.Selenium.Attach Chrome Browser 9222 alias=site1
RPA.Browser.Selenium.Go To https://google.com
RPA.Browser.Selenium.Attach Chrome Browser 9223 alias=site2
RPA.Browser.Selenium.Go To https://duckduckgo.com
But this is not working, first one is getting connected but the second one is waiting for sometime and then shows error
failed with: WebDriverException: Message: unknown error: cannot
connect to chrome at localhost:9222 from chrome not reachable
Blockquote

You can use Selenium Grid.
Create a Hub:
java -jar sel.jar -role hub -port 9000
Create as many Node you need.
You can run chrome on each node:
java -Dwebdriver.gecko.driver="/driver/geckodriver" -sel.jar -role webdriver -hub http://localhost:9000/grid/register -port 9001
java -Dwebdriver.gecko.driver="/driver/geckodriver" -sel.jar -role webdriver -hub http://localhost:9000/grid/register -port 9002
You can check the nodes using below:
http://localhost:9000/grid/console

Related

"Client side error after launching browser" with testcafe

I am trying to launch browser with a url that could record audio and video. using test cafe. After launching, I see a an Application error, A client side exception has occurred. Below is my code.
Browser Console Message
My arguements to run the test -
yarn run testcafe --hostname chrome e2e\launchwebSDK.js --live --use-fake-ui-for-media-stream --use-fake-device-for-media-stream
It's likely that this problem occurs because Chrome doesn't allow calling the getUserMedia API from insecure origins. I recommend you specify localhost as a hostname or enable https mode to bypass this limitation:
testcafe --hostname localhost ...
or
testcafe --ssl pfx=/path/to/cert.pfx ...

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.

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.

Having trouble launching Google Chrome through Selenium RC server on Ubuntu

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.