selenium.common.exceptions.WebDriverException: Message: Can not connect to the 'chromedriver' error when using Python3 on Windows OS - eclipse

I'm using a Windows 7 OS and trying to run a selenium webdriver test using python from my Eclipse+ PyDev IDE. I have downloaded the Google Chrome driver and added it to my path. I've also added the chromedriver.exe to C:\Python34\Scripts. I have tried the following:
from selenium import webdriver
driver = webdriver.Chrome()
I get the error message
selenium.common.exceptions.WebDriverException: Message: Can not connect to the 'chromedriver'
when I try to run my script. I've also tried the following:
driver = webdriver.Chrome(executable_path="C:\folder\chromedriver.exe")
I get a message saying file cannot be found. If I try the following from the terminal:
driver = webdriver.Chrome()
The browser is launched so it works from the terminal. The issue is running my script from Eclipse.

I work with this on Ubuntu but i came across the same kind of error, the problem was that i didn't have a sym-link to the chrome driver file,
In Ubuntu it is
sudo ln -s ~/selgrid/chromedriver /usr/local/bin/chromedriver
This might help
http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/
Good Luck!

Related

How can I fix the attribute error in VS code when the same code runs perfectly on colab?

I was running the PySINDy package and I kept on getting the module not found-error when I ran this:
pip install pysindy
import pysindy as ps
I fixed this by downgrading the Python in my VS code to 3.8.9. But I do get the following note:
note: This error originates from a subprocess, and is likely not a problem with pip.Note: you may need to restart the kernel to use updated packages.
I am now getting the attribute error when I run the following:
differentiation_method = ps.FiniteDifference(order=2)
Here's the error:
AttributeError: module 'pysindy' has no attribute 'differentiation'
Can someone please help me with this? (I successfully ran the entire code earlier on google colab and the online Jupyter, but I am unable to do it locally. I use MAC os and Jupyter via VS Code.)

Cannot install MongoDB Community on Apple M1

I have an Apple M1 using macOS Monterey and I am trying to install MongoDB community latest version. After following the documentation on the website I received this error message (note: I am using a Rosetta terminal because M1 chips do not support homebrew). Does anyone know what is happening with this error? Please help.
What I have tried:
stopping and restarting the service and again it does not work when I then type "mongo" or "mongosh" I get an error to refuse to connect.
I also tried uninstalling and reinstalling many times.
Possible error is the line Already downloaded: /Users/katejohnson/Library/Caches/Homebrew/downloads/5bd79f1c70119d0cda4b01fc074ad77ad00a7e8dfc9b243016157d9ee7009874--mongosh-1.3.1.bottle_manifest.json When I download it (see terminal screenshot)
brew services start mongodb-community#5.0
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/katejohnson/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.
Terminal screenshot
Restart your macOS. Run brew services start mongodb-community#5.0. It should fix the problem!
The issue is with the .plist file that needs to be present in LaunchAgents directory for launchctl to run mongod service on startup.

Eclipse (2018-09) CDT project with Cygwin, can't debug the binary

It seems that everything cygwin-related configured and works fine in my Eclipse project, for example Eclipse is able to invoke 'make' or 'gcc', and can even run the compiled binary and show the output in the Eclipse console window.
However, when I try to debug my binary within Eclipse, I get the following error:
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
During startup program exited with code 0xc0000135.
I do able to launch gdb from my Cygwin console, so it is installed correctly (I assume). But why it fails when I try to use it from Eclipse?
For my case, as you say, it turns out that adding the Cygwin bin folder to the PATH variable solves this problem.
I use Eclipse 2020-06 and Cygwin 64bit on Win7 64bit. And installing Cygwin doesn't change the PATH variable currently.
But it is also confused to me that "build" and "run" work fine in Eclipse whithout the Cygwin bin in PATH.

Could not run VS Code on CentOS 7 with x2go

I have installed the latest version of VS Code on CentOS 7.
However when I try to run VS Code, it loads for some time trying to open, but then nothing happens, no errors, nothing.
I have tried to installed both trough rpm package and zipped files, but got the same result in both cases.
I'm using x2go to connect to my CentOS 7.
Add the following line to the file /etc/x2go/x2goagent.options:
X2GO_NXAGENT_DEFAULT_OPTIONS+=" -extension BIG-REQUESTS"
Then restart the server and try again.
I had the same problem and added the --verbose flag to get more info (see below). Googling for the "gl_surface_glx.cc" error brought me to https://github.com/atom/atom/issues/4360 which contains the above workaround. VS Code now works for me on CentOS7 with X2GO.
Without this workaround the following error is seen (using the --verbose flag):
$ code --user-data-dir=/home/user1646217
--verbose [19526:0719/091952.335817:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected
[19526:0719/091952.335923:WARNING:audio_manager.cc(278)] Multiple
instances of AudioManager detected
[19549:0719/091952.363736:ERROR:gl_surface_glx.cc(411)] GLX 1.3 or
later is required.
[19549:0719/091952.363836:ERROR:gl_initializer_x11.cc(130)]
GLSurfaceGLX::InitializeOneOff failed.
[19549:0719/091952.366430:ERROR:gpu_child_thread.cc(327)] Exiting GPU
process due to errors during initialization

Selenium 2 : Android drivers installation - Jetty not get started and in localhost wd hub not found

My aim is to run tests in android emulator using selenium2 downloading android drivers
Followed the same steps mentioned in the http://code.google.com/p/selenium/wiki/AndroidDriver
a) JDK / JRE installed
b) Android SDK (windows) is there
c) Created AVD and got the 3.2 version OS target from the SDK manager
d) Started the emulator and installed the selenium android server in the emulator ( installed webdriver APK )
e) Got Selenium standalone server installed 127.0.0.1:4444/wd/hub/static/resource/hub.html ( displayed sessions )
f) Done the port forwarding adb -s emulator-5554 forward tcp:8080 tcp:8080
g) Ran this command adb -s emulator-5554 shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity
h) My webdriver started displayed - Webdriver ready
But the issue is Jetty not get started ( not displayed in emulator as Jetty started )
And the android server not available at localhost:8080/wd/hub from the host machine. ( tried using ipaddress also .. no joy )
When I ran my test by changing to driver = new AndroidDriver();
Failure: SetUp : OpenQA.Selenium.WebDriverException : Unexpected error.
Error 404 Not Found
HTTP ERROR: 404
Problem accessing /hub/session. Reason:
Not Found
Powered by Jetty://
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Can anyone help why this is happening ? and solution for the same
Thanks in Advance
Be sure in the AVD you set up your emulator to have an SDCARD with a nonzero size. Selenium appears to require an SDCARD to write temporary data, and the server will silently fail when you try to create a driver, causing what appears to be on the end user to be a 404 or similar error.