Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium typeKeys strips out dot from the String being typed

The following instruction

Selenium.typeKeys("location", "gmail.com");

types the string gmailcom instead of gmail.com.

What's happening there?

From the comments:
I am trying to simulate autofill and the only way to do it currently on selenium is to combine type and typeKeys. eg:

selenium.type("assigned_to", split[0]+"@");
selenium.typeKeys("assigned_to", "gmail.com");

Now my question is why typeKeys doesn't type the 'dot' in between gmail.com?

like image 920
Afamee Avatar asked Jan 24 '23 16:01

Afamee


1 Answers

Have you tried using the Native key functions and javascript char codes? I couldn't get a 'period' character to work using them (char 190), but I got the decimal (char 110) to work just fine, and the text box shouldn't have a problem with either.

selenium.Focus("assigned_to");
selenium.Type("assigned_to", split[0]+"@");
selenium.TypeKeys("assigned_to", "gmail");
selenium.KeyPressNative("110");
selenium.TypeKeys("assigned_to", "com");
like image 58
s_hewitt Avatar answered Jan 26 '23 05:01

s_hewitt