I am just getting started with Selenium. Right now I'm using Python. I tried this:
from selenium import webdriver
driver = webdriver.Edge()
and got the error message:
WebDriverException: Message: 'MicrosoftWebDriver.exe' executable needs to be in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687
So I followed the link and downloaded the latest version, but got a new error:
driver = webdriver.Edge('edgedriver_win64\msedgedriver.exe')
SessionNotCreatedException: Message: session not created: This version of MSEdgeDriver only supports MSEdge version 90
Current browser version is 81.0.416.77 with binary path C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
Now I don't know what to do. The earlies version for the webdrvier found from the download link is 88.
Update edge browser or use a previous version of driver
You can download previous version from:
https://msedgewebdriverstorage.z22.web.core.windows.net/
Click next page till you get the version you want ,
Related
Using selenium webdriver with Edge browser. Worked fine until last night/morning. Errors are:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of MSEdgeDriver only supports MSEdge version 96
Current browser version is 98.whatever. It says the application was modified on 2/3 of this year, which I didn't consent to as far as I can remember.
Why did that catch? Did it automatically install an update without letting me know? Why would that be?
In any case, TLDR, how do I fix this?! and which does Selenium dislike: my edgeDriver, or Selenium being out of date? should I REVERT EdgeDriver by finding an older version (how?), or would it be best to update Selenium somehow?
I use Firefox. I click a button but the page opens as a new tab and selenium stays focused on the original page with the button. I'm trying to switch and get the new url.
time.sleep(4)
second_driver.switch_to.window(second_driver.window_handles[1])
print(second_driver.current_url)
I get:
selenium.common.exceptions.InvalidArgumentException: Message: Expected "handle" to be a string, got [object Undefined] undefined
I also tried the following but it didn't have an effect. I still got the url of the old page.
second_driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.TAB)
This was a Geckodriver bug. It was resolved on the 0.27.0 version release:
https://github.com/mozilla/geckodriver/releases
I have used to experience the same issue with the 0.24.0 version and then I have upgraded the Geckodriver to this version, and then the issue stopped happening.
However, I recommend using always the latest version of Geckodriver. I have checked with the 0.29.0 version and the bug is also gone.
Pretty straightforward. On a Mac, using chromedriver in python. Here is the code:
from selenium import webdriver
EXE_PATH = r'chromedriver'
driver = webdriver.Chrome(executable_path=EXE_PATH)
driver.set_window_size(1024, 768)
driver.get('file:///index.html')
But it always crashes on the line:
driver.set_window_size(1024, 768)
The error it gives:
selenium.common.exceptions.WebDriverException: Message: unknown error:
cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=75.0.3770.80)
(Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.13.6 x86_64)
As you can see my chrome version is 75.0.3770.80 and my chromedriver version is 2.29.461585. I believe these versions should work together. Is this a version mismatch issue or something else?
This error message...
selenium.common.exceptions.WebDriverException: Message: unknown error:
cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.29
Release Notes of chromedriver=2.29 clearly mentions the following :
Supports Chrome v56-58
You are using chrome=75.0
Release Notes of ChromeDriver v75.0 clearly mentions the following :
Supports Chrome v75
So there is a clear mismatch between ChromeDriver v2.29 and the Chrome Browser v75.0
Solution
Upgrade ChromeDriver to ChromeDriver v2.75 level.
Keep Chrome version at Chrome v75 levels. (as per ChromeDriver v2.75 release notes)
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.
Currently I'm using multiple exceptions in a for loop. However, they are still throwing exception errors and I'm not certain why they are not being handled.
Here is my code:
for x in range (15):
actions.click_and_hold(element1).move_to_element(element2).release().perform()
try:
WebDriverWait(driver, 5).until(
EC.visibility_of_element_located((elementLocator))
)
return True
except (StaleElementReferenceException, TimeoutException):
break
Here is the error being thrown:
StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
(Session info: headless chrome=67.0.3396.30)
(Driver info: chromedriver=2.36.540469 (1881fd7f8641508feb5166b7cae561d87723cfa8),platform=Mac OS X 10.13.4 x86_64)
I don't see any issue in your code block as such but your main issue seems to be in the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.36
Release Notes of chromedriver=2.36 clearly mentions the following :
Supports Chrome v63-65
You are using chrome=67.0
Release Notes of ChromeDriver v2.38 clearly mentions the following :
Supports Chrome v65-67
So there is a clear mismatch between the ChromeDriver version (v2.36) and the Chrome Browser version (v67.0)
Solution
Upgrade ChromeDriver to current ChromeDriver v2.38 level.
Keep Chrome version at Chrome v67.x levels. (as per ChromeDriver v2.38 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
I've been working with the following code, trying to introduce myself to selenium. When it runs, the chrome browser opens, but the page is blank, with no source code a far as I can tell, and 'data;' in the address bar. Any information on why this is happening would be greatly appreciated.
from selenium import webdriver
browser = webdriver.Chrome(service_args = ['--ignore-ssl-errors=true', '--ssl-protocol=TLSv1'])
url = 'https://www.google.com/'
browser.get(url)
I have also tried it without the service_args and tried it specifying the driver path and both, but get the same result each time
The most possibility is your browser not compatible with the webdriver. Please confirm your browser version and webdriver version.
My chrome version is 60 and chromerdriver is chromedriver_2.30.exe
You can find compatible version from here
Update the chromedriver and Chrome Browser, sometime I also faced this issue.
I don't see any error as such in your code. Though the documentation for service_args is missing in the Selenium-Python API Docs as well as in the ChromeDriver Getting started Doc. But 0096850 clearly suggests service_args is implemented.
The service_args works well at my end. Hence I suspect there is a mismatch between Selenium version, chromedriver version and Chrome version we are using. First and foremost, we have to ensure that our Selenium version, chromedriver version and Chrome version are compatible. You can find the compatibility information on the Downloads page of ChromeDriver individually for each releases.
The Downloads page clearly mentions:
Latest Release: ChromeDriver 2.32 Supports Chrome v59-61
Additionally, you may be required to pass the argument executable_path to mention the absolute path of the chromedriver binary as follows:
Windows 8 based code:
from selenium import webdriver
browser = webdriver.Chrome(executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe', service_args = ['--ignore-ssl-errors=true', '--ssl-protocol=TLSv1'])
url = 'https://www.google.com/'
browser.get(url)
I've met the same problem,but I solved it by updating my webdriver
Update your webdriver of chrome ,here is the link https://sites.google.com/a/chromium.org/chromedriver/downloads
If you're using Codeception, start the test with :
$I->amOnPage('/');
simply add this argument to selenium options (google how add options on solenium python to how to add options argument)
options.add_argument("--remote-debugging-port=9225")