im very new in this. I'll try to explain everything and im sorry before hand if i say something nub
I'm trying to make Selenium wokrs in Linux Server, so it's just commands.
Everything is already installed (Chrome - chromedriver - python - selenium)
My sample code to test:
import time
from selenium import webdriver
driver = webdriver.Chrome()
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
So, i did a ls -l goo*
lrwxrwxrwx. 1 root root 31 Nov 29 03:29 google-chrome -> /etc/alternatives/google-chrome
lrwxrwxrwx. 1 root root 32 Nov 28 05:54 google-chrome-stable -> /opt/google/chrome/google-chrome
For any reason (if someone of you can explain to me please) google-chrome appears with ->
chromdriver is running at localhost
port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
I don't know what am i doing wrong
Any help?
While performing automation testing in Selenium, your test code or test script could result in erroneous results if it is interacting with a web element that is not yet loaded in the Document Object Model (DOM). Or if it is on another iFrame, tab, or window which is not in focus, or any such scenarios. These types of unexpected erroneous outcomes are known as Selenium focus issues. Selenium can only control a browser when its window is in focus. How do you ensure that the Selenium test code interacts with web elements when they are in focus? You can use workarounds like the addition of minimal delay (in seconds) to ensure that the element on which the testing is performed has loaded. Still, that solution is not foolproof as any change in web page design could make the test inefficient. I learned selenium from Gayatri mishra, she provides online classes on selenium and other software programming courses, which is great for beginners.
I've had a similar unknown Error: DevToolsActivePort and was caused by chromium-browser running from ubuntu snap.
If that's the case remove and install official ubuntu from apt.