GNOME Bugzilla – Bug 578123
generatekeyevent fails for slash and colon characters
Last modified: 2018-09-11 19:53:15 UTC
ldtp.generatekeyevent function doesn't seem to generate the correct sequence for some characters such as slash or colon. For example, when testing firefox location bar: >>> ldtp.launchapp("firefox"); ldtp.generatekeyevent("<ctrl>lhttp://www.gnome.org"); ldtp.gettextvalue("*Firefox", "txtLocation") u'http\xd1--www.gnome.org' Could that be related to the current keyboard layout? Are there any escape sequence for those characters such as <slash> or <colon>? Please let me know if there's any place in which all those escape sequences are listed (ldtp.py doesn't point to any place).
This works in Ubuntu 8.10 atleast like this when I tried in ipython prompt In [3]: wait (2);generatekeyevent ("<ctrl>l");wait (1);generatekeyevent("<ctrl>lhttp://www.gnome.org");wait (1);gettextvalue("*Firefox", "txtLocation") Out[3]: 1 Out[3]: 1 --------------------------------------------------------------------------- LdtpExecutionError Traceback (most recent call last) /home/nags/work/ldtp/<ipython console> in <module>() /usr/lib/python2.5/site-packages/ldtp.py in gettextvalue(windowName, componentName, startPosition, endPosition) 744 _responseStatus, _responseData = getresponse (_requestId) 745 if _responseStatus [0] != 0: --> 746 raise LdtpExecutionError (_responseStatus [1]) 747 return _responseData [1] 748 except LdtpExecutionError, msg: LdtpExecutionError: u'Unable to find object name in application map' Thanks
Hello, I'm afraid that in my machine your one line script it isn't working. As I pointed out in my previous comment, it might be related to using a different keyboard layout (spanish in my case). Regarding the escape sequences, I guess there are no escape sequences for slash or colon, right? Best regards, Javier
(In reply to comment #2) > Hello, > > I'm afraid that in my machine your one line script it isn't working. As I > pointed out in my previous comment, it might be related to using a different > keyboard layout (spanish in my case). Not sure, how to reproduce in my scenario. Any inputs will be highly appreciated > > Regarding the escape sequences, I guess there are no escape sequences for slash > or colon, right? Yes you are right Thanks
Hello, This is also happening in my virtual machines. It might take long time to setup the environment, but I would say that a regular installation with spanish keyboard would fail that way. Best regards, Javier
(In reply to comment #4) > This is also happening in my virtual machines. It might take long time to setup > the environment, but I would say that a regular installation with spanish > keyboard would fail that way. Javier, If I set the keyboard input settings to Spanish is enough ? I can test it that way through Preferences->keyboard and in Keyboard Preferences application, Layouts tab. Correct me, if my assumption is wrong. Thanks
Hello, Yes, that should be enough. I've tried to switch my keyboard layout to UK and the generatekeyevent function has worked correctly so the problem is clearly related to the keyboard layout. Best regards, Javier
(In reply to comment #6) > Hello, > > Yes, that should be enough. I've tried to switch my keyboard layout to UK and > the generatekeyevent function has worked correctly so the problem is clearly > related to the keyboard layout. Sorry for my delayed response. Today I tried with Spanish keyboard layout settings, it seems to work fine. After selecting it, I have just applied the settings to system wide and I haven't logged out / logged in. Will this effect !?! Thanks
Fixed in LDTP 1.7.0. Please verify the same. Thanks for the bug report.
Hello Nagappan, Thanks for solving the problem. I'll certainly verify it. Best regards, Javier
I'm afraid this isn't solved yet. I've tested it in both ldtp-1.7.1 and ldtp-2.0.1
(In reply to comment #10) > I'm afraid this isn't solved yet. I've tested it in both ldtp-1.7.1 and > ldtp-2.0.1 Javier, can I get a VM to reproduce this issue ? It was implemented with this - bug # 590755. Can you check that patch as well ? Thanks
Javier, can you try with this and see if it works ? http://ikester.blogspot.com/2007/01/im-huge-fan-of-autohotkey.html If this works, then we should fix LDTP, maybe copy the way they do ;-) Thanks
LDTP has moved to Github. If the problem reported in this GNOME Bugzilla ticket still exists in a recent LDTP version, please feel free to report the issue at https://github.com/ldtp/ldtp2/issues Thanks for your understanding and we apologize for the inconvenience!