ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine with GeckoDriver and Firefox
Your code block was near perfect. I took your own code and made couple of tweaks which includes inducing WebDriverWait before invoking send_keys()
on the USER ID field as follows:
Code Block:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox(executable_path=r'C:\Utility\BrowserDrivers\geckodriver.exe')
driver.get("https://www.fedex.com/apps/fedextracking/?cntry_code=us&locale=us_en#")
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//input[@class='fxg-field__input-text' and @name='USER']"))).send_keys('test')
driver.find_element_by_xpath("//input[@class='fxg-field__input-text' and @name='PASSWORD']").send_keys('test')
driver.find_element_by_xpath("//button[@class='fxg-button fxg-button--orange' and @name='login']/span").click()Browser Snapshots:
USER ID
andPASSWORD
fields being filled up:
- Error due to wrong credentials:
Python selenium: WinError 10053 - host is shutting connection down
I got the same problem, my config is:
Firefox 60.0.2 (64 bits)
; geckodriver 0.21.0 ( 64 bits)
; selenium 3.12.0
I resolved this problem by downgrade geckodriver to 0.20.1 ( 64 bits)
java.io.IOException: Connection was aborted by the software in your host machine with Sendkey() in selenium java
This error message...
java.io.IOException: java.util.concurrent.ExecutionException:
java.io.IOException: Connection was aborted by the software in your host machine
...implies that the exception was raised due to concurrent execution.
As per the discussion ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine with GeckoDriver and Firefox this issue is observed when you attempt to invoke sendKeys()
when a JavaScript / jQuery was still active.
Solution
The solution will be to induce WebDriverWait for the JavaScript / jQuery to complete using either of the ExpectedConditions:
elementToBeClickable(By locator)
: An expectation for checking an element is visible and enabled such that you can click it.elementToBeClickable(WebElement element)
: An expectation for checking an element is visible and enabled such that you can click it.
What has to be done to delay the execution of next line in firefox browser while running robot scripts?
Can you share your environment details - namely the version of the selenium library, Firefox and geckodriver.
There are reports this issue appears with selenium 3.12.0 and geckodriver 0.21.0, and is fixed with downgrade to geckodriver 0.20.1.
And it's fixed/not present with selenium 3.14.0 and geckodriver 0.21.0.
I'd suggest you get your environment in one of the two version sets, if it's not already there, preferably the later.
Related Topics
Calculate Monthly Returns from Daily Returns in Pandas(Cumpound)
Hiding Raw_Input() Password Input
Convert String to Python Class Object
Python: Getting Around Division by Zero
Sum Numbers of Each Row of a Matrix Python
Pyspark Data Frame Converting False and True to 0 and 1
How to Concisely Replace Column Values Given Multiple Conditions
Numpy: How to Pick Rows from Two 2D Arrays Based on Conditions in 1D Arrays
Python - How to Sort Multidimensional List to Two-Dimensional List
Using Opencv to Overlay Transparent Image Onto Another Image
Python - Outputting Variables to Txt File
What Is the Correct Way to Make My Pyqt Application Quit When Killed from the Console (Ctrl-C)
Python Pandas: Nameerror: Name Is Not Defined
Python Serial: How to Use the Read or Readline Function to Read More Than 1 Character At a Time
Python: Split a List into Multiple Lists Based on a Subset of Elements
How to Convert a Pandas Dataframe to a Pytorch Tensor