I am using selenium-server-standalone-2.41.0.jar on Mac OSX 10.8.5 with Java 7 Update 55.
Everything works fine with Firefox up to version 25.0.1 but if I try v26, v27, v28 or v29 of Firefox, then my code will open up firefox and it will just hang (nothing loads on firefox screen).
When I downgrade Firefox back to v25 then it all starts working again fine.
Any thoughts or suggestions?
Thanks
EDIT: Posted problem on Selenium bug forum as well:
https://code.google.com/p/selenium/issues/detail?id=7279
There actually quite a few other threads on people having this same issue with Firefox starting up and a blank screen just sitting there doing nothing. I tried all combinations of Firefox from v25.0.1 to v33 with all versions of selenium-server-standalone from v2.41.0 to v2.44.0 and the only combination I can get to work is FF v25.0.1 with SSS v2.41.0.
So I finally came up with a workaround for this problem so I can use FF v33 for normal surfing and keep Selenium working with FF v25. This is what I did:
(1) I updated my day to day Firefox to the newest version.
(2) I downloaded a second older version of Firefox (v25.0.1) from here https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/25.0.1/ Then on my Mac I installed onto the Desktop and then renamed the it from Firefox.app to Firefox25.0.1.app and then moved it into my Applications folder.
(3) I created a new second profile for Firefox from here https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles and named it ffSeleniumProfile
(4) I then had to make sure the config file still had the default profile as the default. On Mac, look in ~/Library/Application Support/Firefox/profiles.ini file and it should look something like this (note that Default=1 should be under Profile0 )
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=Profiles/abcd1234.default
Default=1
[Profile1]
Name=ffSeleniumProfile
IsRelative=1
Path=Profiles/a1b2c3d4.ffSeleniumProfile
(5) For Selenium Server Standalone, make sure you are using v2.41.0 selenium-server-standalone-2.41.0.jar from here http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
(6) Finally when you are starting Java and calling for Firefox/FirefoxDriver you will need to specify it to use Firefox25.0.1.app and the ffSeleniumProfile. I did this by adding the following System.setProperty to my main method of the primary java file that I use when starting java:
public static void main(String[] args)
throws InterruptedException,MalformedURLException {
System.setProperty("webdriver.firefox.bin", "/Applications/Firefox25.0.1.app/Contents/MacOS/firefox-bin");
System.setProperty("webdriver.firefox.profile", "ffSeleniumProfile");
}
Now when I start Selenium Java, it will use v25.0.1 of firefox along with the second profile, and when I just start firefox from my desktop it will use the default profile and whatever the newest version I have upgraded too.
Again this is a workaround only, but it solves my problem for now.
Hey Try Disabling some Add-ons in your Firefox browser one by one and try running the code This helped me on windows . Try it once..
Related
Here is the error:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: unexpected command response
(Session info: chrome=103.0.5060.53)
I'm using proper webdriver and chrome version:
Here is the script, its job is to open a webpage from the normal user data directory and provide a response.
from seleniumwire import webdriver # Import from seleniumwire
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("user-data-dir=C:\\selenium")
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get('https://katalon.com/
')
for request in driver.requests:
if request.response:
print(
request.response.status_code,
)
You need to upgrade Google Chrome and your Chrome Driver to version 104:
Install Google Chrome Beta from here: https://www.google.com/chrome/beta/
Update ChromeDriver to 104 manually (it is not in brew yet) https://chromedriver.storage.googleapis.com/index.html?path=104.0.5112.20/
Set the chrome_options.binary_location:
Windows - "C:\Program Files\Google\Chrome Beta\Application\chrome.exe"
MacOS - "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"
There is a known issue with non-headless chromedriver browsers, you can read more about it here.
As of now there has not been a fix for chromedriver version 103 or less.
EDIT: This has been fixed for Chromedriver version 103 as well. Download chromedriver's latest 103 version from here.
What you can do:
Upgrade to chromedriver version 104 and use the Google 104 Beta version, following Dmytro Durach's instructions. The issue is definitely fixed as seen in the patch notes for chromedriver version 104.
Use a headless browser. Instructions on configuring chromedriver headless.
Use the incognito workaround found here. It seems to work for a few people.
Wait until the issue is fixed. From what I can tell they are actively working on it. Any updates will be posted here.
Use a try...except block to infinitely retry (not recommended).
There has been issue with chromeDriver 103 version and there is an issue raised for the same with Chromium community.
Please find below the bug ids for the same,
https://bugs.chromium.org/p/chromedriver/issues/detail?id=4121&q=label%3AMerge-Request-103
You can see all the conversations in the above bug thread.
For now, until this issue is fixed try to "Downgrade Chrome Browser To v102" and "Download Selenium Chrome Driver 102" and try to run your script, as this issue is happening in 103 version.
Because of this reason, Selenium community has closed the issue with regard to the same because the issue is related to Chrome team.
https://github.com/SeleniumHQ/selenium/issues/10799
I built in a static wait; it's not elegant, but it worked for my purpose:
import time
time.sleep(5)
I think this will work but as a temporary workaround.
while True:
try:
driver.get('https://katalon.com/')
break
except:
continue
On chrome version 103, If you open the chrome with incognito and disabled site isolation trials it would not give this error
options = webdriver.ChromeOptions()
options.add_argument("--incognito")
options.add_argument("--disable-site-isolation-trials")
driver = webdriver.Chrome(chrome_options=options)
I was getting the same reported error with Chrome ver=103: “Message: unknown error: cannot determine loading status from unknown error: unexpected command response”, although my error is generated from clicking an element.
I tried the following suggestions listed above which did not work: Incognito mode, headless browser (which would not work for my application), adding time.sleep(10).
(I am adverse to loading the Chrome beta version 104, at this time.)
What is peculiar about this error (at least in my application) is that while an exception is thrown, I can see that the code generating it (clicking an element) actually executes as expected - the element IS in fact clicked.
So I have had success with just ignoring the error with the following code:
try:
next_elm.click()
except:
pass
And then continuing with the rest of my code.
Not a very elegant work-around, but it works in my application.
Solution in Code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
# 1
option = Options()
option.binary_location='/Applications/Google Chrome
Beta.app/Contents/MacOS/Google Chrome Beta'
# 2
driver = webdriver.Chrome(service=Service(ChromeDriverManager(version='104.0.5112.20').install()), options=option)
see: this thread
when i go to command prompt and type chromedriver -v:
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945#{#614})
but when i try to run this code :
from selenium import webdriver
class InstaBot:
def __init__(self):
self.driver=webdriver.Chrome()
self.driver.get("www.instagram.com")
InstaBot()
it gives me error like this:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
why this is happening i tried to remove selenium as well as chromedriver
and reinstall of version 79.0.3945 but when i run it ,it show this can only be run on version 80
my chrome version is 79.0.3945 which is lastest ,and version 80 chrome is chrome beta
This error message...
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
...implies that the ChromeDriver v80.0 was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You mentioned about using chromedriver=79.0.3945.36 and the release notes of chromedriver=79.0 clearly mentions the following :
Supports Chrome v79
Presumably you are using chrome v79.0 browser.
So, it's quite evident your have chromedriver=80.0 present within your system which is also within the system PATH variable and is invoked while you:
self.driver=webdriver.Chrome()
Solution
There are two solutions:
Either you upgrade chrome to Chrome Version 80.0 level. (as per ChromeDriver v80.0 release notes)
Or you can override the default chromedriver v80.0 binary location with chromedriver v79.0 binary location as follows:
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe')
driver.get('http://google.com/')
You can find a detailed discussion in Ubuntu: selenium.common.exceptions: session not created: This version of ChromeDriver only supports Chrome version 79
Additional Considerations
Ensure to:
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Reference
You can find a relevant detailed discussion in:
How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
Use Bonigarcia plugin in project. After that it will manage all driver by itself.It reads chrome version and instantiate driver accordingly.
for help follow my post :
https://www.linkedin.com/pulse/webdrivermanager-bonigarcia-rohan-ravi-yadav/
or original git link/post
https://github.com/bonigarcia/webdrivermanager
If any help required , Let me know
it's a super serious problem for me in my project. I googled, and tried myself, but nothing solved.... I m trying to execute automated tests on Firfox browser .... I m developping my tests using java and selenium on Windows 10 as my OS .. my automated tests can run under chrome with no problem but when I launch my tests on firefox it throws the browser opens but it throws an error "Unsecured connection (in frensh : La connexion n’est pas sécurisée ) ....
Down is my code and a screnn shot of firfpox browser throwing the error while trying to run tests
I launch my tests successivly as a group of tests gathered using jar,
here is my code as shown bellow with a screen shot of the thrown error :
I solved my ISSUE :) ... just in case , for the ones that may have this problem with Firefox #INSECURE CONNECTION error#
I'm working with :
OS :
Windows 10 (64 bits)
Browser :
Firefox v60.0.1 (32 bits)
And,
SELENIUM 3.5.3
merionette driver to gecko driver
Solution (as shown in the image attached):
Instead of this -> System.setProperty("webdriver.firefox.marionette", path.toString());
I used this -> System.setProperty("webdriver.gecko.driver", path.toString());
I hope it will help anyone who is facing the same problem
Thanks
:)
Regards
I am facing below error when i run the selenium from gocd server to window server via ssh .
Unexpected error launching Internet Explorer. IELaunchURL() returned
HRESULT 80070002 ('The system cannot find the file specified.') for
URL 'http://localhost:9516/' (WARNING: The server did not provide any
stacktrace information)
but it working fine if i run same script in windows server itself.
Configuration:
- selenium version : 3.11
- IE browser version : 11.09
- OS : Windows server 2012 R12
- IE 32 driver version : 3.14
(I tried in lower version also 2.14 also)
same script is working fine for chrome..
Issue
Note: i configured already IE zoom settings, protected mode ...
I had the same issue in NodeJS that I resolved. (I know this is old but I wanted to post in case someone else runs into this issue)
Not sure how your environment is configured, but for me using ServiceBuilder.setEnvironment caused this issue. When I let WebDriver inherit the current environment everything runs fine.
If you're not using a custom environment I would ensure that your PATH variables are set correctly and that you can run Internet explorer from a command prompt by typing 'iexplore' indicating it's in your PATH properly.
Asking because I'm following Guru99's time sensitive selenium course and the code that I have downloaded as part of my project will not run as a java application.
It is supposed to be ran with only this code:
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
public class TestScript01 {
public static void main(String[] args) throws Exception {
WebDriver driver = new ChromeDriver();
String baseUrl = "http://www.demo.guru99.com/V4/";
// launch Firefox and direct it to the Base URL
driver.get(baseUrl);
// Enter username
driver.findElement(By.name("uid")).sendKeys("xxxx");
// Enter Password
driver.findElement(By.name("password")).sendKeys("xx");
// Click Login
driver.findElement(By.name("btnLogin")).click();
}
}
However, I have added: import org.openqa.selenium.WebDriver; and System.setProperty("webdriver.chrome.driver",
"C://selenium/chromedriver.exe");
I've also not included my real username and password in code above
I have downloaded Chrome driver to the selenium folder in my C drive
I was trying to run from firefox initially but was stuck on Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms errors, which I downgraded my firefox for as that worked for many on this site, but it was still giving me the same error so I switched to Chrome, which selenium seems to prefer. I'm using the latest version of Chrome and Firefox 47.0
I'm using selenium 3.6.0 and jdk 1.8.0_111
When trying to run as an application, according to the instructions, I seem to be in a loop where I keep getting this screen:
I have never had to select an option in order to run a selenium script before, not sure why I'm getting it now or what I'm supposed to select if any.
I have googled but it seems that most instructions for running selenium tests do not include this pop-up. I thought that instantiating a new WebDriver object and selecting the right imports were enough, what am I missing?
You havn't mentioned the Selenium, ChromeDriver, Chrome Browser and JDK versions. Assuming you are using the latest version of Selenium, ChromeDriver, Chrome Browser and JDK, I would suggest a few steps as follows:
Instead of import org.openqa.selenium.*; always use import org.openqa.selenium.WebDriver; and the required ones.
While working with Selenium 3.x (Java) it is mandatory to mention the following line :
System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver.exe");
In this line you have to either use single front slashes / or you have to use escaped back slashes \\
The screen with Select Java Application indicates there are multiple overlapping imports in your project or methods from overlapping jars. We need to keep only the used imports in your script & used jars in your project and remove the other imports/jars from your script/project to keep it simple.
From your IDE take a Project -> Clean for all the projects and keep Build Automatically selected.
Error Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms can arise for many reasons. The best remedy is to uninstall the Browser with Revo Uninstaller, Run CCleaner to wipe out all the rotten OS stuffs and take a system reboot and trigger your Test.