-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Press Key issue with combined keys #67
Comments
I also have combo commands for |
Code looks quite good that it should work. I will investigate on Keyboard module where the problem comes. I think it would be a good advice to extend keyboard tests by a gui element which send the response from entered input to a input field to verify if keyboard bindings work as expected. |
@Nepitwin Any update? Related... |
@Mavnus04 oh i don't see your question. t'' syntax is used for a text usage and s'' by syntax For example if you want to input into a text field you should use t"Your Text Here" By a shortcut you use s"CTRL+A" this type of can be mixxed up by a list For example ${EXP_VALUE_OVERRIDE_INPUT_TEXT} = Override |
What i can also see from docs
You want to create a shortcut so s is correct for my opinion. So the input from your sample code should work i will investigate your example until next week. |
@Nepitwin |
This documentation is outdated. The only thing that the Keyword is doing that Press Key can be used by XPATH optional to focus the element before a keyboard execution is triggered. So it's quite similar like your code Focus Is equivalent to Press Keys I will now extend the test gui by a keyboard testing view. Which displays the keyboard inputs and extend the testcases by multiple keyboard bindings then i should find easily the issue. |
Keyboard input example extended Keyboard robot file adjusted Unecessary documentation removed
Keyboard input example extended Keyboard robot file adjusted Unecessary documentation removed
Ah now i see what the issue is. You try to use the VirtuaKeyShort with simple mapping. But what i can see is that +,- and equals is not supported from current Key mapping to flaui
I will extend the missing VirtualKeyShort bindings. Afterwards you can use the KeyShorts by corresponding bindings FlaUILibrary.Press Key t'ALT+SHIFT+SUBTRACT' <-- Should already work |
@Nepitwin I got the Keyboard branch my system and built. If I hold As you can see, I am getting |
Forgot to mention, that when I try |
From sample application the intresting part is that WPF is sending System Event if you first execute ALT keyboard. If you execute first ALT by Down Event you got system. Your source code i think will handle to wait for ALT event :) So it does not recognize it. The question is why system key event is triggered. |
If your keyboard binding is first use ALT it will be executed as system by windows If your source code will handle on System and not Alt it probably work? |
Tried putting
|
Oh cool you test by a unity based application. Is their any kind of keyboard interaction be triggered by flaui? For example you set a simple input by keyboard or an ESC to open the main menu? If yes sounds good so far. If not i have to investigate which keyboard event is be triggered from flaui. So it could be related for the tripple usage binding or probably that any keyboard events are not triggered by unity because the simulation from the keyboard is not handle correctly by windows :). |
Yes, it is a game created with Unity. In my last example, I can send the character But for some reason, combining those key presses will not go through. |
Do you have a small source code sample application for it like the wpf example? I could then analyze triggered events from unity and flaui to identify the issue probably. |
Sorry, I can't share anything from my company, but I could try making a simple Unity application which accepts and responds to some simple key presses. |
I have also thought of such an example application :). No problem we have all work to do :) |
Keyboard input example extended Keyboard robot file adjusted Unecessary documentation removed
@Nepitwin W = White
Manually pressing the keys, I have no issue changing the color.
The source code is 55MB, so I am not sure how to share that with you, if you need it? GitHub said the upload limit is 25MB |
Thanks a lot i will investigate what happens on flaui side now by this sample application and hopefully find the issue 👍 |
What i can see by my tests that an array is created with correct converted syntax SHIFT (0x10) + ALT (0x12) + BACKSPACE (0x8) Type simualtenously method is called which shoud execute all these keyboard bindings It's quite strange |
Sample implementation without example project for analyze purpose.
Okay i found some issues related to FlaUI by Alt Keyboard usage. FlaUI/FlaUI#295 Also the C# sample code have the same behavior like robotframework usage here.
I will retry FlaUI by a master build from current source code if it's working then i will update the flaui wrapper to the latest master version. But it seems a known issue on flaui that the combinations usage by ALT does not work like expectly. |
From my point of view it's a keyboard issue on flaui. So the general idea was is to replace the keyword module by something different by keyword modules like Pyinput - https://nitratine.net/blog/post/simulate-keypresses-in-python/ But after some additional analyze i also found https://stackoverflow.com/questions/13564851/how-to-generate-keyboard-events Which cause issues on keyboard handling by ui automation especially for games. So in general my plan is now to implement a plugin system like selenium already has. This interface could be used for use cases like yours to implement workaround keywords by handling seperatly on your use case. I will implement as soon as possible to make a new release and support this feature. So afterwards this ui automation library can be used and extended by anyone with this plugin system for all specific acceptance criterias. |
Nice investigation! |
@Nepitwin How is it going? Wondering if you could provide an update? |
Currently i'm busy at work to do a quick fix for it and i think about the plugin mechanis if this behavior should fix it. I'm not sure. But you can already try a second solution to write a simple Keyword by your own in python code. I think you know that this possiblity is always supported by robotframework. Simple write a Python file and define a custom keyword which probably contains a sub call by another keyboard library which you include and use for your use case. It would not solve the issue on flaui side but for thie one case your e2e test would work :). |
I already have something that can send all these key commands for my testing purposes. My hope was to replace it with FlaUI since it supports so much more. Please let me know once you have a fix in, thanks. |
Sample implementation without example project for analyze purpose.
@Nepitwin Hey, checking for an update? |
Currently no news about an upcoming change how to fix your issue by unity. The only thing what i found is that flaui is sending by SendInput controls keyboard interactions. https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput |
I am having an issue pressing several keys on my application.
I can send a single key press with t'~' without an issue. But when I try to send
ALT+SHIFT+-
orALT+SHIFT+=
, it seems to respond only to the keys-
or=
. Yes, this key combo normally works on the application.As you can see in my example, I tried sending it as t'' or s'' or assign it as a string, then sending it.
Current version:
Related...
I don't understand the difference between the t'' and s'', can you explain more with an example?
Finally, can you clear up this statement?
If identifier set try to attach to given element if operation was successfully old element will be reattached automatically.
When does the attachment occur and to which element.The text was updated successfully, but these errors were encountered: