Nice programing

IE 브라우저의 텍스트 필드에서 Selenium WebDriver 입력이 매우 느림

nicepro 2021. 1. 10. 19:56
반응형

IE 브라우저의 텍스트 필드에서 Selenium WebDriver 입력이 매우 느림


스크립트가 다음을 사용하여 텍스트 필드에 입력 할 때 IE 11브라우저에서 스크립트 중 하나를 실행 Selenium 2.43.1하고 있습니다.

element.sendKeys("string");

IE 브라우저에서 문자열의 한 문자가 텍스트 필드에 입력되고 다음 문자를 입력하기 전에 1-2 초 동안 대기하는 것을 볼 수 있습니다. 한 문자를 입력하는 데 1-2 초가 걸립니다.

  1. IE에서 타이핑이 느린 이유는 무엇입니까?
  2. 타이핑 속도를 높일 수있는 다른 방법이 있습니까?

내 문제는 드라이버 아키텍처에 관한 것이었고 32 비트를 다운로드하고 사용하여 해결했습니다.

여기서 32 비트로 전환하려면해야 할 일이 있습니다.

  1. http://selenium-release.storage.googleapis.com/index.html 에서 32 비트 드라이버 서비스를 다운로드합니다 .
  2. 32 비트 드라이버 서비스에 대한 경로가있는 InterExplorerWeDriver클래스를 사용하여 InternetExplorerDriverService클래스를 인스턴스화하십시오 .

    InternetExplorerDriver ieDiver = new InternetExplorerDriver(“Path to the 32 bit Explorer driver”);

또는 빌더를 사용하는 경우 :

System.setProperty(“webdriver.ie.driver”,“C:\\drivers\\IEDriverServer.exe”);
DesiredCapabilities ieCapabilities=DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver
 .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
ieCapabilities.setCapability("requireWindowFocus", true);
File ie_temp=newFile(“C:\\Selenium\\IEDrivertemp”);
InternetExplorerDriverService.Builder 
ies=newInternetExplorerDriverService.Builder();
ies.withExtractPath(ie_temp);
InternetExplorerDriverService service=ies.build();
WebDriver driver=newInternetExplorerDriver(service,ieCapabilities))

해결하는 데 도움이 된 스레드

http://forumsqa.com/question/typing-too-slow-in-text-fields-while-replaying-tests/


나에게는 64 비트 버전의 IEDriverServer와 함께 작동했습니다. "true"값으로 requireWindowFocus 속성을 추가했습니다.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
...
capabilities.setCapability("requireWindowFocus", true);
WebDriver driver = new InternetExplorerDriver(capabilities);

Selenium / IE Driver 2.47 버전을 사용하고 있습니다.


64 비트 WebDriver의 경우 :

  1. IE 열기
  2. 인터넷 옵션 → 고급 → 보안으로 이동하십시오.
  3. 선택 ☑ 향상된 보호 모드에 대해 64 비트 프로세스 사용
  4. 적용 및 확인을 클릭하십시오.

32 비트 WebDriver의 경우 :

  1. IE 열기
  2. 인터넷 옵션 → 고급 → 보안으로 이동하십시오.
  3. 선택 취소 ☐ 향상된 보호 모드에 대해 64 비트 프로세스 활성화
  4. 적용 및 확인을 클릭하십시오.

이상하게 :

  • 강화 된 보호 모드의 활성화 여부에 관계없이 설정이 필요했습니다.
  • 대화 상자에 표시된 텍스트 외에는 컴퓨터를 다시 시작할 필요가 없습니다.

내 설정 : Windows 10, IE 11, 모든 64 비트, Selenium 3.4


이것은 나를 위해 조금 빨라졌습니다. IEDriverServer 2.53.1

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.RequireWindowFocus = true;
driver = new InternetExplorerDriver(options);

32 비트 버전으로 변경할 수 있지만 64 비트가 필요한 경우이 솔루션을 시도 할 수 있습니다.

  • 인터넷 옵션-> 보안-> 모든 영역에 대해 "보호 모드 사용"을 선택하십시오.
  • 고급-> 보안-> "향상된 보호 모드 활성화"를 선택하십시오.

이로 인해 64 비트 IE에서 더 이상 달팽이 입력이 발생하지 않습니다.


64 비트 버전의 IEDriverServer를 사용할 때도 같은 문제가 발생했습니다. 32 비트로 변경하면 정상적으로 작동합니다.

출처 : WebDriver 및 IE10 매우 느린 입력


나는 또한 같은 문제를 겪었습니다. 시도해 볼 수 있습니다.

인터넷 옵션-> 연결-> LAN 설정-> 선택 해제 자동으로 설정 감지 .

도움이 되었기를 바랍니다.


For tests running on IE11 64bit, setting the NATIVE_EVENTS capability to false worked for me. Without it, using the 64bit driver server 3.0 was extremely slow as reported. The 32bit 3.0 driver server swallowed some of the chars it was supposed to send (e.g. "FluentLenium" became "FlntLnum").

The following resolved both problems.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
WebDriver driver = new InternetExplorerDriver(capabilities);

I am not sure whether this has additional side effects.


I also faced the same issue with IE11 on Windows x64 bit. I was using 64bit version of IEDriverServer.exe (IE driver-3.7.0 with selenium-3.7.0).

After I changed to 32bit version of IEDriverServer.exe, it solved the issue


This probably is an issue with the machine you are running the test on. If you experience general lag with the computer, then this will happen.

Is there an alternate way to speed up typing?

Sure, you can create a custom method to clear the text, then use JavaScript to fill the field. (mind you that doing this, might not be able to work with things like "typeahead" and "suggestions as you type")


I struggled almost a day for finding out. This is because the 64 bit IE Driver sever (IEDriverServer_x64_2.53.1).

I switched to IEDriverServer_Win32_2.53.1 then it worked, it is superfast now!


Disable NATIVE_EVENT resolved my issue

 DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
 capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
 driver = new InternetExplorerDriver(capabilities);

You can change to 32 bit version,it will be speed compare to 64 bit.


Instead of WebEelement.send.keys, I used Actions object with sendKeys method. This worked like a charm.


to improve the speed for send Keys function, one can perform below steps:-

  1. go to project-->properties->Java compiler-->under the java compliance --deselect the use compliance option and change the compile compliance level to 1.7 and then click to apply.

It will work smoothly.


For IEServerDriver 3.14.0 this works for speeding up typing a bit.

WebDriver browser;
InternetExplorerOptions options = new InternetExplorerOptions();
    options.disableNativeEvents();
    options.requireWindowFocus();
browser = new InternetExplorerDriver(options);

DesiredCapabilities method is deprecated and options.IntroduceInstabilityByIgnoringProtectedModeSettings = true; and options.RequireWindowFocus = true; are no longer available.


The below code helped me with resolving the issue.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
...
capabilities.setCapability("requireWindowFocus", true);
WebDriver driver = new InternetExplorerDriver(capabilities);

ReferenceURL : https://stackoverflow.com/questions/27985300/selenium-webdriver-typing-very-slow-in-text-field-on-ie-browser

반응형