Hi,
I have this code (a lot) in my solution.
Report.Info("Key 'Return' Press.");
Keyboard.Press(Keys.Return, 28, Keyboard.DefaultKeyPressTime, 1, false);
Now I updated to 6.2 and cannot build solution:
The name 'Keys' does not exist in the current context(CS0103)
What could be the problem and how to fix it?
Ranorex 6.2 Keyboard.Press(Keys
Re: Ranorex 6.2 Keyboard.Press(Keys
Hi,
You need to add keyword WinForms. in front of Keys keyword, like this:
See the breaking changes in Ranorex 6.2 Release notes:
http://www.ranorex.com/release-notes.html#c15287
You need to add keyword WinForms. in front of Keys keyword, like this:
Code: Select all
Keyboard.Press(WinForms.Keys.Return, 28, Keyboard.DefaultKeyPressTime, 1, false);
http://www.ranorex.com/release-notes.html#c15287
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Ranorex 6.2 Keyboard.Press(Keys
Hi SanMan,
In order to get this working again, just delete the "Winforms" in the using directive like in the following screenshots.
Change this: To this: You could also use the namespace directly in the keyboard.press method like in the screenshot below. I hope this helps.
Kind regards,
asdf
In order to get this working again, just delete the "Winforms" in the using directive like in the following screenshots.
Change this: To this: You could also use the namespace directly in the keyboard.press method like in the screenshot below. I hope this helps.
Kind regards,
asdf
Re: Ranorex 6.2 Keyboard.Press(Keys
Hi asdf,
I'm afraid, that's not exactly correct solution. Using WinForms is forced from 6.2 and any reference of using System.Windows.Forms; is automatically deleted from UserCode.cs files. Please see the Breaking Changes section of Ranorex 6.2 Release notes.
I'm afraid, that's not exactly correct solution. Using WinForms is forced from 6.2 and any reference of using System.Windows.Forms; is automatically deleted from UserCode.cs files. Please see the Breaking Changes section of Ranorex 6.2 Release notes.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Ranorex 6.2 Keyboard.Press(Keys
Thank you for quick help!!

