C# Selenium webdriver:IE 11发送键-在输入(文本框)中选择全部(Ctrl+;A)文本

C# Selenium webdriver:IE 11发送键-在输入(文本框)中选择全部(Ctrl+;A)文本,c#,internet-explorer,selenium,webdriver,C#,Internet Explorer,Selenium,Webdriver,我有一种在自动测试中使用(Ctrl+A)选择文本的方法 public static void SelectText(IWebElement input) { Actions actions = new Actions(driver); actions.Click(input).SendKeys(Keys.Control + "a").Perform(); } 在Chrome和Firefox方法中选择text(工作)。但在IE中,11不起作用。 在IE中,它只键入“a” 例如:输

我有一种在自动测试中使用(Ctrl+A)选择文本的方法

public static void SelectText(IWebElement input)
{
    Actions actions = new Actions(driver);
    actions.Click(input).SendKeys(Keys.Control + "a").Perform();
}
在Chrome和Firefox方法
中选择text
(工作)。但在IE中,11不起作用。 在IE中,它只键入“a”

例如:输入中是文本“lorem ipsum”。在IE中,此方法在值“lorem ipsuma”的末尾附加“a”

我的配置: Windows 8.1,Selenium版本2.46.0,IEDriverServer.exe(x86版本)

IE初始化

InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.EnableNativeEvents = false;
IWebDriver driver = new InternetExplorerDriver(ieOptions);
如何修复它?

请尝试使用并单独使用
Build().Perform()
isntead
Perform()

  char c = '\u0001'; // ASCII code 1 for Ctrl-A

  actions.Click(input).SendKeys(Convert.ToString(c)).Build().Perform();

我使用的是浏览器开关,在为IE11运行时,我使用以下代码选择全部:

input.SendKeys(""); // focus element
SendKeys.SendWait ("^a"); // use windows to send input

我正在使用.NET,这就是我的工作原理:

input.SendKeys(Keys.Control & "a")

在Internet Explorer中,这对我很有用

Actions actions = new Actions(_driver);
            actions.Click(IWebElement);
            actions.Click(cellProjectName).SendKeys("GU" + "Project" + "-" + consecutiveProjects).Perform();

在C#

中,你能重新设置句子的框架吗?应用程序会在你输入的每个字符后连续发布吗?谢谢:)。这是有效的。我有一个问题。为什么我可以使用硒的方法?是硒虫还是IE虫?我也不是100%确定。我想问题与InternetExplorerWebDriver实现有关。由于IE的COM接口让人头疼,所以驱动程序非常黑客(非常感谢Jim Evans让这个项目保持活力)。我们都希望当微软为IE发布自己的、原生的WebDriver实现时,它会变得更好。哦,对不起,当然是“Edge”。