07-18-2023, 06:47 PM
Since <kbd>Ctrl</kbd>+<kbd>A</kbd> maps to ASCII code value 1 (<kbd>Ctrl</kbd>+<kbd>B</kbd> to 2, up to, <kbd>Ctrl</kbd>+<kbd>Z</kbd> to 26).
Try:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Internal;
using OpenQA.Selenium.Remote;
namespace SeleniumHqTest
{
class Test
{
IWebDriver driver = new InternetExplorerDriver();
driver.Navigate().GoToUrl("http://localhost");
IWebElement el = driver.FindElement(By.Id("an_element_id"));
char c = '\u0001'; // ASCII code 1 for Ctrl-A
el.SendKeys(Convert.ToString©);
driver.Quit();
}
}
Try:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Internal;
using OpenQA.Selenium.Remote;
namespace SeleniumHqTest
{
class Test
{
IWebDriver driver = new InternetExplorerDriver();
driver.Navigate().GoToUrl("http://localhost");
IWebElement el = driver.FindElement(By.Id("an_element_id"));
char c = '\u0001'; // ASCII code 1 for Ctrl-A
el.SendKeys(Convert.ToString©);
driver.Quit();
}
}