Issues with Shift Key

Class library usage, coding and language questions.
ki2_23
Posts: 6
Joined: Mon Jul 21, 2014 7:58 am

Issues with Shift Key

Post by ki2_23 » Wed May 13, 2015 6:07 am

Ranorex version : 5.1.3.19973
Windows version : Windows 8.1
Technology of system under test : JAVA

Hi we are having a strange problem while executing our scripts in cloud.

To login to our application we use email-id as our username like '[email protected]'
but while executing we are seeing a different pattern being entered like '[email protected]>COM' or '[email protected]>COM' after analyzing the the patterns we understood that {SHIFT} key is been triggered at some point and hence we are seeing these patterns. So, we came up with a code just before login to reset all Keys to be UP as shown below, even then we are having same issues while executing in cloud. we also checked in the angle of our keyboards fault and fixed as suggested in following link but not luck :( http://www.tomshardware.com/answers/id- ... games.html

This issue is very random but fails our scripts nightly . Any :idea: are welcomed :)

Code: Select all

            Keyboard.Up(Keys.ShiftKey);
            Keyboard.Up(Keys.LShiftKey);
            Keyboard.Up(Keys.RShiftKey);
            Keyboard.Up(Keys.Shift);
            Keyboard.Up(Keys.LControlKey);
            Keyboard.Up(Keys.RControlKey);
            Keyboard.Up(Keys.Control);
            Keyboard.Up(Keys.ControlKey);
            Keyboard.Up(Keys.Alt);

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Issues with Shift Key

Post by odklizec » Wed May 13, 2015 7:51 am

Hi,

I don't have a clue what could be the reason of your issue, but have you considered using Set Value recording action (SetAttributeValue via code)? With this you can pass the string in expected format and without messing with shift key.
Here is how it should look like in code:

Code: Select all

repo.repoelementname.Element.SetAttributeValue("Text", "[email protected]'");
In recording, simply select the target repository element from repository window and drag&drop it to recording table. Then from the appeared context menu select Set Value action and appropriate attribute.
Pavel Kudrys
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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Issues with Shift Key

Post by krstcs » Wed May 13, 2015 1:42 pm

The problem with SetAttribute (or any other Set action) is that it doesn't always fire events the same way that direct keyboard input would. Use them with caution.


My first suggestion would be to upgrade to a supported version of Ranorex (5.3.2 is current) and see if that fixes the issue. 5.1 is no longer being updated/supported. If you can't update to 5.3 because you don't have a support contract, then you can upgrade at least to 5.1.4 to get the bug fixes there. You should always keep Ranorex within a couple of bug-fixes of the current version.

Second, did you record this key-stroke action, or did you create it manually in the action table? If you recorded it, you might look at the code-behind (the *.cs file) and make sure there isn't anything in there that shouldn't be, such as a SHIFT-DOWN without a SHIFT-UP.
Shortcuts usually aren't...

ki2_23
Posts: 6
Joined: Mon Jul 21, 2014 7:58 am

Re: Issues with Shift Key

Post by ki2_23 » Thu May 14, 2015 4:11 am

We are not using Ranorex Studio for our project, we are only working at API level using all Ranorex dlls.

we use Keyboard.Press() for data entry.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Issues with Shift Key

Post by krstcs » Thu May 14, 2015 4:52 pm

Then I would suggest that you need to go back over your code and check for any un-paired Down-Up actions.

Also, you should upgrade just in case this is a bug. I think I remember there was an issue with one of the builds that would see things like this.

Again, always keep your Ranorex installations up-to-date with the latest bug fixes. Your version (5.1.x) is no longer supported. Current version is 5.3.2.

If you don't have a current support contract, you can download the 5.3.2 version and run it for 30 days in trial mode to check if it fixes your issue. If so, you will need to purchase a license and update.
Shortcuts usually aren't...

rastek
Posts: 157
Joined: Wed Aug 06, 2014 12:00 pm

Re: Issues with Shift Key

Post by rastek » Mon Feb 13, 2017 2:24 pm

Hi, I have a similar issue , working on s special environment where normal presskey does not help.

I need to press shift - (shift + _) on some input can somene help me for this ?

can it be done on recording manue, or needed to be handled in code level, if so how =?

User avatar
N612
Posts: 62
Joined: Mon Jul 11, 2016 4:01 pm

Re: Issues with Shift Key

Post by N612 » Mon Feb 13, 2017 10:27 pm

What about key shortcut action? This function is designed for keyboard shortcuts such as KEY1+KEY2.

rastek
Posts: 157
Joined: Wed Aug 06, 2014 12:00 pm

Re: Issues with Shift Key

Post by rastek » Wed Feb 15, 2017 10:11 am

OK thanks !