Open remote debugging mode in an already open chrome browser - selenium

I am trying to open "remote debugging mode" in an already running chrome browser.
Here is the command I am executing:
chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\Users\Ideal\AppData\Local\Google\Chrome\User Data"
But when I visit http://127.0.0.1:9222/json/version, nothing shows up.
However, if I close the browser and then run the same process, then http://127.0.0.1:9222/json/version works great.
So how can I open remote debugging mode in an already running Chrome browser?

Related

Setup Required to Run TestCafe tests on Safari browser

I'm attempting to execute a TestCafe suite on locally installed Safari. I have previously executed the tests on chrome, chrome:headless, firefox, and firefox:headless. When running the command testcafe --list-browsers to retrieve my list of installed browsers, I receive the following:
testcafe --list-browsers
Using locally installed version of TestCafe.
firefox
chrome
safari
When I execute a simple test via command line, testcafe safari path/to/tests/, the Safari browser will launch, but no navigation takes place. I remain on the launch window (showing my favorites and recently visited pages).
When the same command is executed for a different browser (say, testcafe chrome path/to/tests/), the tests are executed in the local browser.
Am I missing something that is required to get Safari up and running with TestCafe? I'm using TestCafe version 1.6.1. I'm not seeing any additional setup mentioned on the TestCafe documentation...
I was able to resolve this issue by disabling all uses of TestCafe Browser Tools in System Preferences -> Security & Privacy -> Privacy -> Automation. On my subsequent execution, I was prompted to allow TestCafe Browser Tools for Safari. After accepting the prompt, the tests ran as expected.
I also had deleted my node_modules directory and reinstalled dependencies, although I'm skeptical if that helped.

Firefox Crash in Selenium

I use Selenium to do the web-scraping. However, my Firefox browser always crashes after a while (it is very intensive the task of scraping).
The error message from Firefox:
Firefox had a problem and crashed. We’ll try to restore your tabs and
windows when it restarts.
The error message from Python:
selenium.common.exceptions.WebDriverException: Message: Tried to run
command without establishing a connection
I'd like to know if there's a way to deal with that. Ideally, I want something like after Firefox crashes, Selenium would open a new tab and continue from where it crashed.
i tried try: except:pass this type of code and they didn't work out.

How to use selenium with autoit for file upload in a Headless chrome browser?

I'm trying to automate a webpage in selenium on a chrome browser which is integrated into a TeamCity server.
The code is working perfectly in my local machine.
File upload is done with Autoit scripts but when running through TeamCity on chrome browser ,typically as a headless chrome browser ,the script fails as it fails to find the next element(The file uplod fails).
This is not possible...
Headless browser cannot interact with os components(open dialog box)
You can use sendkeys to input field(browse button),which will not trigger open dialog box, since the browser is headless and you can skip using Autoit for headless browsers, which needs a Gui.

How to set the browser to open in Private window/Incongnito mode in IntelliJ

In IntelliJ, the targeted browser can be configured for web apps. Anyone knows how to configure to open the browser in private window - Firefox and Chrome ?
For Chrome you just need to open the Web Browsers section in Preferences and then edit the Chrome option. Set the Command line options to -incognito and Chrome should start in incognito mode.
For Firefox I expect you need to start it in private mode. This URL starts Firefox on my Mac but I can't get it to work in IntelliJ
/Applications/Firefox.app/Contents/MacOS/firefox -private
This is the only one setup that worked for me.
Chrome incognito
Check if Allow in incognito is switched on for JetBrains IDE Support extension (chrome://extensions/)
open WebStorm preferences -> Tools -> Web browsers -> Chrome -> Edit -> Command line options: -incognito
Run Chrome incognito window manually

cannot open web instpector in chrome with selenium test

I am trying to inspect the page during an integration test, and so I have a test which I added a breakpoint in-- Once chrome launches and the test begins, the breakpoint hits, and the browser is idle.. As soon as I open the web inspector, chrome quits with the error:
Selenium::WebDriver::Error::WebDriverError:
disconnected: received Inspector.detached event
I am using Chrome version 37.0.2062.124, and ChromeDriver version 2.10.267517
This is intended. This is because the ChromeDriver uses the DevTools API to interact with Chrome.
The DevTools within Chrome has one major disadvantage and that is it only allows one debugger (whatever that might be, whether it's you or the driver itself) attached to it. Thus, once you open it, ChromeDriver cannot use it.
This is a limitation of Chrome -> the best you can do is get your test to a point where it fails, have your test close it's session but leave the browser open. Thus you have quit your test but effectively left your browser in the state of which the test failed.
This is about chrome issue(https://bugs.chromium.org/p/chromedriver/issues/detail?id=1194).
When you are running selenium program, you cannot press F12 to open dev tools manually, or it'll throw this exception sometimes.
According to the issue list, it looks like fixed, but I still meet this bug in ChromeDriver 2.29
The same problem you can visit.