Selenium WebDriver 在 IE 浏览器的文本字段中打字速度很慢 [英] Selenium WebDriver typing very slow in text field on IE browser

查看:36
本文介绍了Selenium WebDriver 在 IE 浏览器的文本字段中打字速度很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Selenium 2.43.1IE 11 浏览器上运行我的一个脚本当脚本使用以下内容在文本字段中键入时:

I'm running one of my scripts on IE 11 browser with Selenium 2.43.1 when the script types in text field using following:

element.sendKeys("string");

在 IE 浏览器中,我可以看到在文本字段中输入了一个字符串字符,它在输入下一个字符之前等待 1-2 秒.表示输入一个字符需要 1-2 秒.

In IE browser, I can see that one character of string is typed in text field and it waits for 1-2 seconds before typing next character. Means for typing one character it's taking 1-2 seconds.

  1. 为什么用 IE 打字这么慢?
  2. 有没有其他方法可以加快打字速度?

推荐答案

我的问题与驱动程序架构有关,并通过下载和使用 32 位驱动程序架构来修复它.

My issue was with the driver architecture, and fixed it by downloading and using a 32bit one.

在这里切换到 32 位是你必须做的

To switch to 32 bit here is what you have to do

  1. http://selenium-release.storage.googleapis 下载 32 位驱动程序服务.com/index.html
  2. 使用实例化您的 InterExplorerWeDriverInternetExplorerDriverService 带有 32 位驱动程序路径的类服务.

  1. Download 32 bit driver service from http://selenium-release.storage.googleapis.com/index.html
  2. Instantiate your InterExplorerWeDriver class using InternetExplorerDriverService class with path to 32 bit driver service.

InternetExplorerDriver ieDiver = new InternetExplorerDriver(32 位资源管理器驱动的路径");

OR 如果使用构建器:

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/

这篇关于Selenium WebDriver 在 IE 浏览器的文本字段中打字速度很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆