Forum Discussion

asdfasdfasdfasd's avatar
asdfasdfasdfasd
Contributor
16 years ago

Working with DevComponents WpfEditors (.NET WPF)

Hi, our WPF AUT has had DevComponents WpfDock, WpfRibbon, and WpfEditors for
a while now. I'm coming across a situation where setting a value to a DevComponent
object that used to work before, using its 'Value' property, no longer works
for one reason or another. At this time, I cannot determine if it's TestComplete
or AUT.


The class is IntegerInput class and I'm trying to use the 'Value' property
to set a value, but it requires a Nullable(Of Integer) type. This type cannot
be reproduced in the TestComplete environment (I think). I could as a workaround
use the up/down controls, but it's somewhat inconvenient and I'd rather set
the value directly.


Here are some more notes:


1. In Object Browser, Value property description says:


System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]] Value;


2. I tried looking for .NET methods to set the value and the only methods
I found were SetValue and its overloaded siblings, but I'm unable to use
them due to argument requirements that it needs (e.g., System.Windows.DependencyPropertyKey).


If it's possible to get some assistance, I'd appreciate it.

8 Replies

  • Hi Steve,

    I'm coming across a situation where setting a value to a DevComponent object that used to work before, using its 'Value' property, no longer works for one reason or another.



    Could you please tell me in what version of TestComplete this worked?



    Here is how you can make this work at the moment:

    '...


    Dim obj


    Set obj = ...WPFObject("IntegerInput", "", 1)


    intvalue = 123


    dotNETvalue = <proces name>.AppDomain("<domain name>").dotNET.System.Int32.Parse(intvalue)


    obj.Value = dotNETvalue 


    '...
  • Hi Steve,




    We have looked into this problem further and found that it can be caused by the out-of-date version of .NET Framework. Please install the latest .NET Framework updates. Also, if you have Windows XP SP2, install Service Pack 3 for Windows XP.




    Please let me know if this information helps.

  • Thanks David for the information.  I will apply the information provided here and report back.
  • Hi David,



    I attempted to work with Allen via Support email, but he told me to work with you on a problem I have with dotNET object.  After using this solution for the WpfEditor controls, I began to notice Microsoft Visual C++ Error messages sometimes appear after these calls.



    Here's my email to Allen:



    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <meta content="Word.Document" name="ProgId" />
    <meta content="Microsoft Word 12" name="Generator" />
    <meta content="Microsoft Word 12" name="Originator" />





    Hi Allen,




    Yes regular values do not work against these fields.  There are currently three different types we
    use - System.Integer, System.Double, System.DateTime.


    I created a forum thread about this
    and David suggested to use the dotNET object to give me the correct type and it
    works except sometimes this error message comes up.


    [Microsoft Visual C++ Runtime Library


    Runtime Error!


    Program: C:\...


    R6034


    An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information]


    We're using DevComponents.WpfEditors.IntegerInput,
    DevComponents.WpfEditors.DoubleInput, DevComponents.WpfEditors.DateTimeInput
    fields.


    Here's a code sample:




    var object = NameMapping.Sys.pCatalyst.[More Child
    Objects Here].WPFObject("mCustomEndTime");


    var dotNETValue =
    NameMapping.Sys.pCatalyst.AppDomain("UNX.Catalyst.Application.exe").dotNET.System.Double.Parse(value);


    object.value = dotNETValue;


    Again, the error message does not abort script
    execution.  After clicking Ok to dismiss
    the message, the script continues to run and sets the value in the field.




    Steve






  • Hi Steve,




    We failed to reproduce the problem on our machines. We used the "<DevComponents>\Samples\Editors.exe" sample application and your code works fine with it. Could you please check whether you can reproduce the problem with this sample application?

  • aditya_n's avatar
    aditya_n
    Occasional Contributor
    Hi



    I am using keyword driven testing for a date control where i have to select a date from the date field.

    However when i run the script after recording the selected date is not visible.

    pls can anyone suggest any solutions.

    I am using TC 8.0 for .net windows app.Also m using devexpress 10.2 and .net framework is 3.5



    regards,

    Aditya.
  • Hi Aditya,



    First of all, please install the latest version of TestComplete which is 8.70



    If the problem persists with the latest version of the tool, please reproduce it, pack the entire project suite folder and send the archive to us using the Contact Support form.