cancel
Showing results for 
Search instead for 
Did you mean: 

Keys Action misses entering a space

SOLVED
subbu_valliappa
Contributor

Keys Action misses entering a space

We have this line in our codes for entering parts of a formula:



TestObj.Keys(ELSE IF t ge G THEN)



However, the script has been entering "ELSE IF T geG THEN" on a number of times lately, and I'm not sure why. It's missing the space just before 'G' in the formula.



Does anyone know why this is happening? What can I do to improve the reliability?



Thanks in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
Ryan_Moran
Valued Contributor

RE: Keys Action misses entering a space

I've seen this happen with auto complete on some forms. Does the control support auto complete? You could use set text as Robert suggests as well. I prefer to use .Keys because it more accurately represents what a user will do.



For testing purposes you could try:

Adding a space/

TestObj.Keys("ELSE IF t ge  G THEN")

Breaking up the keys/


TestObj.Keys("ELSE IF t ge")

TestObj.Keys(" G THEN")



Just to see if you get different results.

Hope that helps!

''-Praise the sun and Give Kudos.''

View solution in original post

3 REPLIES 3
tristaanogre
Community Hero

RE: Keys Action misses entering a space

Have you tried SetText instead of Keys?

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Ryan_Moran
Valued Contributor

RE: Keys Action misses entering a space

I've seen this happen with auto complete on some forms. Does the control support auto complete? You could use set text as Robert suggests as well. I prefer to use .Keys because it more accurately represents what a user will do.



For testing purposes you could try:

Adding a space/

TestObj.Keys("ELSE IF t ge  G THEN")

Breaking up the keys/


TestObj.Keys("ELSE IF t ge")

TestObj.Keys(" G THEN")



Just to see if you get different results.

Hope that helps!

''-Praise the sun and Give Kudos.''

View solution in original post

subbu_valliappa
Contributor

RE: Keys Action misses entering a space

Thanks for your replies.



I have tried SetText but I slightly prefer Keys.



Additional space works fine, always. Splitting the statement works on and off, just as before. Interesting find though, but that's what works.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors