0

My apologies to bother all respectable professional here,
I have been struggled in this issue few weeks and can't find any similar solution on others posts,
I have done the correct settings in IE,
such as zoom level/securityTab/disableEnhanceProtectMode..etc via WebDriver Official Manual, but however, this problem persist.

Environment
I'm inside a company intranet, here is my environment:

Platform: Windows 10 Pro (must) (without admin)
browser: IE 11 (must)
Python: 3.7.4
Python Selenium: 3.141.0 (tried 4.0.0a5, see Tried)
IEDriverServer: 3.150.1 32-bit
(tried 32-bit 3.141.0/3.141.59, see Tried. 64-bit some versions been tried too,but same issue occur and with public known send keys slow issues, so not considered.)

Issues:
I want to deploy my python code(open IE and go to web system do something) to 4 computers, so I make their environment the same (like Windows Settings/Internet Options). The issues I faced is when I use below code to launch browser :
In [1]: iedriver = "C:\Python\IEDriverServer.exe"
In [2]: browser = webdriver.Ie(executable_path=iedriver)
In [3]: browser.get("https://Atragedy.WebSystem.com")
In [4]: browser.find_element_by_xpath(textbox).send_keys(str)
In [5]: browser.execute_script('arguments[0].click();', browser.find_element_by_xpath(SubmitBtn))

● Computer1: Everything just works fine.

● Computer2: Python will always stuck in [2] when lauching IE up(can see WebDriver initial page), not reporting any error / not going to [3] / no crashing / no stop responding , but stuck in [2] all day long if I didnt interupt it manually.

● Computer3: Python report error when [2] and not bring up IE(IE11 not appear), the error as below:

MaxRetryError: HTTPConnectionPool Max retries exceeded with url: /session (Caused by NewConnectionError(': Failed to establish a new connection [WinError 10061] No connection could be made because the target machine actively refused it

● Computer4: This computer works normally in [1] to [4], but when [5] excuting javascripts, it stucked just like Computer2's issue, the code will not go to next action and not reporting any errors all day long if I didn't interupt it manually.

Tried
◎ I tried differenet version combination of Selenium and WebDriver such as (Computer As C):

Set1. Selenium 3.141.0 / WebDriver 3.150.1 ---------------(C1 OK, C2&3 are reports C3's error, C4 issue keep).
Set2. Selenium 3.141.0 / WebDriver 3.141.0/3.141.59 --(C1234 are occur C2's error).
Set3. Selenium 4.0.0a5 / WebDriver 3.150.1 ---------------(C1234 are reports C3's error).
Set4. Selenium 4.0.0a5 / WebDriver 3.141.0/3.141.59 --(C1234 are reports C3's error).

※A strange status happen on C1, after tried Set2 on C1, C1 start have issues, even change back to Set1, still occur C2's error on C1, can't repair it.
In final I tried run with Selenium 3.141.0 and IEDriver 3.13.0 on C1 once, C1 back to normal,
futher stranged, now C1 back normal with Set1 too...
(Other computer remain their issues even with Driver 3.13)

◎ I tried clean up the original python environment and install Client level Anaconda(Ver.202002) Environment, but issue still the same, no matter use CMD/original python IDE/Anaconda Spyder 4.

◎ I tried add some code below, but all result are remain the same:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
cap = DesiredCapabilities().INTERNETEXPLORER
cap['platform'] = "Windows"
cap['version'] = "11"
cap['browserName'] = "internet explorer"
cap['ignoreProtectedModeSettings'] = True
cap["ignoreZoomSetting"] = True
cap['nativeEvents'] = False
cap['requireWindowFocus'] = True
cap['INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS'] = True
browser = webdriver.Ie(desired_capabilities=cap, executable_path=r'C:\Python\IEDriverServer.exe')

◎ I tried maunual launch IEDriverServer with 127.0.0.1:5555, and use remote to connect, C3 can lauch IE window now, but goes to C2's issue... (Others Computer remain their own issues.)
browser = webdriver.Remote(desired_capabilities=cap, command_executor='http://127.0.0.1:5555')

I'm currently out of idea to fix this issue, if any senior can provide me solution, or even some hints, I will be veryveryvery appreciated, thank you.

J. David
  • 1
  • 2
  • I suggest you try to keep the Selenium and IE driver server version similar. test with (3.141.0). Try to reset the IE browser on all machines. The step where you find that it is not moving further or not giving any error. It can be possible that it is not able to find the element or page is not loaded completely. in that case, try to add wait statment to pause your code. See whether it makes any difference. Make sure that your Windows os has the same update installed on all the machines. – Deepak-MSFT May 12 '20 at 09:38
  • Thank for your reply :) , these 4 computer are just have enterprise bundles of windows10 reinstalled, so their basic patches and environment are same, and unfortunatly in my experiment, Selenium 3.141.0 with IEDriverServer 3.141.x series are worst than with IEDriver 3.150.1 – J. David May 12 '20 at 09:51
  • Did you test with the wait statements in your code? What output did you get with it? – Deepak-MSFT May 12 '20 at 11:43
  • I tried implement_wait(30) and sleep(10), the issue still persist, because the wait action usually add after the launch action, but this issue is python stucked when launch action. `driver = webdriver.Ie(Path)` `driver.implicitly_wait(30) ` `driver.get(TargetURL)` – J. David May 13 '20 at 02:11
  • I suggest you refer this thread and try to check for the said registry key that may help you with this issue. https://stackoverflow.com/questions/51977120/internet-explorer-11-getting-stuck-randomly-while-executing-tests-through-iedriv – Deepak-MSFT May 14 '20 at 10:20
  • @Deepak-MSFT Thanks for your information, this is a step in IEDriverServer manual, and I already registered it on Computer1 while in tests, but when using Set2, still got the C2 error. – J. David May 19 '20 at 02:32
  • Now I replaced all UAT computers (find others computers which works normal and use it) to avoid this issue, but just don't know when will this issue happen again... – J. David May 19 '20 at 06:38
  • Thanks for updating us with the temporary solution to this issue. You can inform us, whenever next time you meet with this issue. We will try to provide further suggestions for it. Thanks for your understanding. – Deepak-MSFT May 19 '20 at 06:49
  • Hi I am having the same problem with your C2... stuck at driver=webdriver.Ie(). Any ideas? – Gabriel Sep 01 '21 at 12:30

0 Answers0