Problem with DevExpress TextBox

Class library usage, coding and language questions.
bbv_philippdolder
Posts: 10
Joined: Thu Nov 26, 2009 6:54 am

Problem with DevExpress TextBox

Post by bbv_philippdolder » Thu Nov 26, 2009 8:55 am

Hello

I'm having troubles entering text into DevExpress TextBoxes (using DevExpress 7.3.10):

I tried the following:
1. using KitId as a Ranorex.Text type:
Repository.Instance.Editor.Information.KitId.Focus();
Repository.Instance.Editor.Information.KitId.TextValue = lysisKitId;

Then I get the following exception
System.NotImplementedException: The method or operation is not implemented.
at Ranorex.Plugin.WinFormsFlavorElement.SetPropertyValueInternal(String propertyName, Object value)
at Ranorex.Plugin.WinFormsFlavorElement.SetAttributeValue(Element element, String name, Object value)
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
Ranorex.SetAttributeFailedException: Setting attribute 'text' failed on element '{Text:_maskBox}'.
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
at Ranorex.Text.set_TextValue(String value)
at Roche.Mip.Automation.MainForm.MainForm.EnterRunInformation(String mwpId, String reagentKitId, String lysisKitId, Int32 samples) in MainForm.cs: line 106
at Roche.Mip.Automation.PerformRunTest.StartMip() in PerformRunTest.cs: line 45

2. Using KitId as a Ranorex.Element type
Repository.Instance.SampleEditor.Information.KitId.Element.Focus();
Keyboard.Press(id);
It focuses the text box, but the keyboard input is not entered into the text box.

I attached the partial Snapshot from Ranorex Spy. The field I use is: Container "Test Information".Element 'editMwpId'

Am I doing wrong something?
There are always 2 text elements under the "Element editMwpId" node in the spy. I'm never sure which one to use.

Thanks for your reply

Regards
Philipp Dolder
Attachments
TextBoxSnapShot.rxsnp
(3.93 KiB) Downloaded 186 times

bbv_philippdolder
Posts: 10
Joined: Thu Nov 26, 2009 6:54 am

Re: Problem with DevExpress TextBox

Post by bbv_philippdolder » Thu Nov 26, 2009 9:05 am

What I found out so far is that when I call Focus() the text edit gets focus inside the application to test, but the main focus (active window) is on another application that is a simulator which is required to be started before entering the information.

How do I assure that the application under test is the active window?

Anyway, I would highly prefer a solution without using Keyboard.Press().

Regards
Philipp

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problem with DevExpress TextBox

Post by Support Team » Fri Nov 27, 2009 9:50 am

Hi!
You do set the TextValue on the TextBoxMaskBox item which has no implementation of the Textvalue attribute, i.e. the DevExpress control itself throws the NotImplementedException. If you use the overlying Element item (use Ranorex Spy to analyse) and cast it to Ranorex.Control you can set the text to the .Text property.
// sample code
Ranorex.Control elementTextEditSample = "/form[@controlname='FrmMainXtraEditors']/container[@controlname='pcMain']/container[@controlname='gcContainer']/container[@controlname='ModuleTextEdit']/element/container/container[@controlname='panelControl1']/element[@controlname='textEditSample']";

elementTextEditSample.Text = "Text1";
Regards,
Christian
Ranorex Support Team
.
Image

bbv_philippdolder
Posts: 10
Joined: Thu Nov 26, 2009 6:54 am

Re: Problem with DevExpress TextBox

Post by bbv_philippdolder » Wed Jan 13, 2010 1:34 pm

Hello Christian

There is no Control class in Ranorex 2.2.1 (or I can't find it). And I cannot cast it to Text obviously.
Any hints?

Thanks Philipp

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problem with DevExpress TextBox

Post by Support Team » Wed Jan 13, 2010 6:45 pm

Have you added references to all Ranorex.Plugin DLLs to your project? The Ranorex.Control adapter is defined in the Ranorex.Plugin.WinForms.dll, so you need to have a reference to that DLL when you want to use Ranorex.Control in your code. If you use the Ranorex project templates, the DLL references should already be added.
Furthermore, make sure that you have a "using Ranorex;" statement at the top of your code file!

Regards,
Alex
Ranorex Support Team
.
Image