I'm using Selenium to perform testing on both Chrome and IE11 browsers. My goal is to select 2 rows from a table by press the Control and hold it (KeyDown) and then select the 2 rows and finally to release the Control key (KeyUp).
Here is how I init the InternetExplorerDriver:
var explorerOptions = new InternetExplorerOptions
{
IgnoreZoomLevel = true,
IntroduceInstabilityByIgnoringProtectedModeSettings = true,
RequireWindowFocus = true,
EnableNativeEvents = false
};
var driverService = InternetExplorerDriverService.CreateDefaultService("Path to IEDriverServer.exe");
driverService.HideCommandPromptWindow = true;
driver = new InternetExplorerDriver(driverService, explorerOptions);
Here is my C# code:
Actions actions = new Actions(driver);
actions.KeyDown(Keys.LeftControl);
foreach (var index in indexes)
{
actions.Click(tableRows[index]);
}
actions.KeyUp(Keys.LeftControl).Build().Perform();
Note: I tried both LeftControl and Control and both gave the same result.
Any suggestions to fix it? Workarounds are also appreciated.