Skip to content

Commit e6f50ff

Browse files
authored
Merge pull request #92 from bmarroquin/fix-keys
works around issues with the webdriver spec
2 parents 8005715 + 2076fd9 commit e6f50ff

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

src/FlaUI.WebDriver.UITests/ElementTests.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,51 @@ public void SendKeys_AfterShiftedCharacter_ShiftIsReleased()
174174
Assert.That(element.Text, Is.EqualTo("!1Test TextBox"));
175175
}
176176

177+
[Test]
178+
public void SendKeys_UpperAndLowercaseLetters_EntersIdenticalText()
179+
{
180+
var driverOptions = FlaUIDriverOptions.TestApp();
181+
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
182+
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
183+
var qwerty = "qwertyuiopasdfghjklzxcvbnm";
184+
var qwertyS = "QWERTYUIOPASDFGHJKLZXCVBNM";
185+
var all = qwerty + qwertyS;
186+
element.Clear();
187+
element.SendKeys(all);
188+
189+
Assert.That(element.Text, Is.EqualTo(all));
190+
}
191+
192+
[Test]
193+
public void SendKeys_NumbersAndShiftedNumbers_EntersIdenticalText()
194+
{
195+
var driverOptions = FlaUIDriverOptions.TestApp();
196+
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
197+
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
198+
var numberRow = "`1234567890-=";
199+
var numberRowS = "~!@#$%^&*()_+";
200+
var all = numberRow + numberRowS;
201+
element.Clear();
202+
element.SendKeys(all);
203+
204+
Assert.That(element.Text, Is.EqualTo(all));
205+
}
206+
207+
[Test]
208+
public void SendKeys_OtherCharacters_EntersIdenticalText()
209+
{
210+
var driverOptions = FlaUIDriverOptions.TestApp();
211+
using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions);
212+
var element = driver.FindElement(ExtendedBy.AccessibilityId("TextBox"));
213+
var others = "[]\\;',./";
214+
var othersS = "{}|:\"<>?";
215+
var all = others + othersS;
216+
element.Clear();
217+
element.SendKeys(all);
218+
219+
Assert.That(element.Text, Is.EqualTo(all));
220+
}
221+
177222
[Test]
178223
public void SendKeys_DownArrow_IsSupported()
179224
{

src/FlaUI.WebDriver/Keys.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ internal class Keys
101101
{ '8', "Digit8" },
102102
{ '9', "Digit9" },
103103
{ '=', "Equal" },
104-
{ '<', "IntlBackslash" },
105104
{ 'a', "KeyA" },
106105
{ 'b', "KeyB" },
107106
{ 'c', "KeyC" },
@@ -207,7 +206,6 @@ internal class Keys
207206
{ '*', "Digit8" },
208207
{ '(', "Digit9" },
209208
{ '+', "Equal" },
210-
{ '>', "IntlBackslash" },
211209
{ 'A', "KeyA" },
212210
{ 'B', "KeyB" },
213211
{ 'C', "KeyC" },
@@ -235,7 +233,7 @@ internal class Keys
235233
{ 'Y', "KeyY" },
236234
{ 'Z', "KeyZ" },
237235
{ '_', "Minus" },
238-
{ '.', "Period" },
236+
{ '>', "Period" },
239237
{ '"', "Quote" },
240238
{ ':', "Semicolon" },
241239
{ '?', "Slash" },

0 commit comments

Comments
 (0)