Page 1 of 1

Error message

Posted: Wed May 31, 2017 8:56 am
by BeardMJ
Hi

I've been building a very straight forward test but all of a sudden when I went to run it I got the following error message:

'XXXXXXModule' does not contain a definition for 'DefaultKeyPressTime' (CS0117)

I'm not sure what this means? On my other modules the same code looks fine. Any help appreciated.

Regards
Martin

Re: Error message

Posted: Thu Jun 01, 2017 12:46 pm
by Vaughan.Douglas
In your module you've got the following method
/// <summary>
        /// Performs the playback of actions in this recording.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        [System.CodeDom.Compiler.GeneratedCode("Ranorex", "7.0")]
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.00;

            Init();

        }
The DeffualtKeyPressTime value is set at Keyboard.DefaultKeyPressTime = 100;

So I tried to recreate this issue by removing that line of code outside of the code editor, but rebuilding it in Ranorex just re-adds it. I tried eliminating it from a usercode method and it doesn't throw an error.

Can you provide a few more details.
  • Specifically
  • What version of Ranorex are we dealing with?
  • What typeof module
  • If possible could you provide the ITestModule.Run method for the specific module in question

Re: Error message

Posted: Thu Jun 01, 2017 2:37 pm
by BeardMJ
Hi dude

Thanks for the reply, I simply removed the "Keyboard" module I'm testing and it now works as expected. The module had keyboard used a lot. I.e. variables and screenshots were called keyboard so I wonder if this was causing some confusion for the tool.

I'm running 6.2.1
It was a simple record and reply module I was making. I've now renamed the screenshots etc and it works.

Re: Error message

Posted: Thu Jun 01, 2017 3:16 pm
by odklizec
Hi,

I think name of the module is the source of your problem. Name of recording/code module cannot use the same name as Ranorex class names. So if you called it "Keyboard" you have the answer ;) Just rename it to something else.

Re: Error message

Posted: Thu Jun 01, 2017 4:32 pm
by Vaughan.Douglas
BeardMJ wrote:Hi dude

Thanks for the reply, I simply removed the "Keyboard" module I'm testing and it now works as expected. The module had keyboard used a lot. I.e. variables and screenshots were called keyboard so I wonder if this was causing some confusion for the tool.

I'm running 6.2.1
It was a simple record and reply module I was making. I've now renamed the screenshots etc and it works.
That right there would do it! Been there, done similar! :lol: