c#-selenium: problem sendKeys

59 views
Skip to first unread message

Nortier David

unread,
Jun 4, 2025, 4:53:25 AMJun 4
to seleniu...@googlegroups.com

Hello everybody,

 

I have a test where I do a sendKeys("Test RAC10.14 03/06/2025 04:45:24")

 

Only "Test RAC0. 0/0/0 0::" is pasted.

The numbers, except for the 0, are gone!

If I do it manually, no problem, of course.

The problem only occurs on the PC dedicated to daily testing.

 

It's just the regex that has changed. But it accepts the numbers (the proof, by hand, it's fine).

 

Aaaah the mysteries of programming... :-)

 

Any ideas are welcome.

 

 

Thank you !

 

 

 

 

NOD

 


====== DISCLAIMER ======

https://www.cph.be/maildisclaimer

sriram srinivasan

unread,
Jun 4, 2025, 5:54:41 AMJun 4
to seleniu...@googlegroups.com
Java:

for (char ch : "Test RAC10.14 03/06/2025 04:45:24".toCharArray()) {
    element.sendKeys(Character.toString(ch));
    Thread.sleep(100); // wait a bit between keys
}

Or

((JavascriptExecutor) driver).executeScript("arguments[0].value='Test RAC10.14 03/06/2025 04:45:24';", element);


C#:
foreach (char ch in "Test RAC10.14 03/06/2025 04:45:24")
{
    element.SendKeys(ch.ToString());
    Thread.Sleep(100);
}

Or

((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].value='Test RAC10.14 03/06/2025 04:45:24';", element);

Thanks,
Sriram

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/selenium-users/fa04370679434053a4cb265036064531%40cph.be.

Nortier David

unread,
Jun 5, 2025, 1:56:04 AMJun 5
to seleniu...@googlegroups.com

Hello,

Thanks, I saw these "solutions." I'll try them.

The question was more: why has it been working for weeks, and not now?

 

I'm having other "sendKeys" issues on the PC used for testing.

Probably too slow...

 

 

De : seleniu...@googlegroups.com <seleniu...@googlegroups.com> De la part de sriram srinivasan
Envoyé : mercredi 4 juin 2025 11:54
À : seleniu...@googlegroups.com
Objet : Re: [selenium-users] c#-selenium: problem sendKeys

 

ATTENTION : cet e-mail provient d'une personne externe. Vérifiez toujours l’expéditeur avant d’ouvrir les pièces jointes ou de cliquer sur les liens.

Reply all
Reply to author
Forward
0 new messages