Remote debugging Internjs that runs on selenium chromedriver - google-chrome

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.

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 ...

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

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

How do I access a github.com/lucas-clemente/quic-go server from Chrome?

when I ran quic-go-0.18.1(https://github.com/lucas-clemente/quic-go) with command: go run main.go -bind=127.0.0.1:443 -qlog -tcp in dir /example.
I use the client to visit https://127.0.0.1/demo/tile, I could get response:(Proto:"HTTP/3"),
when I use chrome and chrome beta to visit https://127.0.0.1/demo/tile, I find chrome only use http/1.1 to visit my server.
My Question is : How I can use chrome to visit https://127.0.0.1/demo/tile through HTTP/3?
My environment: Ubuntu 20.04 LTS
Chrome switch on enable-quic.
GO version: 15
reading https://www.chromium.org/quic/quic-faq it says:
How do I aim Chrome at the test server? If you have an HTTP server,
you'll need it to emit a response header that looks like:
Alternate-Protocol: quic:< QUIC server port >
Then you can just run chrome as usual and it will automatically start
using QUIC.
If you're testing only with the toy quic server, you can do something
like:
% chrome --disable-setuid-sandbox --enable-quic
--origin-to-force-quic-on=localhost:6121 http://localhost:6121/
If you need help troubleshooting, try running the QUIC server with
--v=1 or check out playing-with-quic
does it solve your issue ? Please report for others.

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.