Forum Discussion

katepaulk's avatar
katepaulk
Occasional Contributor
15 years ago

How can I get TestComplete to select items in a TMS TPlanner component?

I'm trying to select calendar dates in form built with a TMS TPlanner component.



When I tried recording a script, none of the clicks made within the component were recorded.

 

The object inspector recognizes a VCL object TPlannerMonthView, but I can't use any of the properties or methods. For instance, the wDate and wEndDate properties show in the object inspector as read/write, but any attempt to set them fails. Similarly, the SetSelection method fails.



Does anyone know how to access this component through TestComplete?



Thanks,



Kate



(The code below was recorded by test complete - I've added comments)


procedure Test1;


Test1;

var SIAEMaintenance : OleVariant;


var toolBar : OleVariant;


var TBOEditSIAECalendarHeaderForm : OleVariant;


var comboBox : OleVariant;



begin



SIAEMaintenance := Sys.Process('SIAEMaintenance');


toolBar := SIAEMaintenance.BOEditSIAEOptionsForm.ToolBar;


// clicked add item twice because of slow response time


toolBar.ClickItem(0, false);


toolBar.ClickItem(0, false);


TBOEditSIAECalendarHeaderForm := SIAEMaintenance.BOEditSIAECalendarHeaderForm;


TBOEditSIAECalendarHeaderForm.NameEdit.SetText('Working Days');


comboBox := TBOEditSIAECalendarHeaderForm.cboCalendarType;


// Clicked the combo box twice, too, so I could have a reference into the component


comboBox.Click(137, 12);


comboBox.Click(137, 12);


// Here I clicked twice, did several CTRL-Clicks and some dragging.


// Nothing was recorded until I returned to components outside the TPlanner


TBOEditSIAECalendarHeaderForm.chkActive.ClickButton(cbChecked);


TBOEditSIAECalendarHeaderForm.btnAddSelected.ClickButton;


TBOEditSIAECalendarHeaderForm.OKButton.ClickButton;



end;


;


3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    One thing I did notice was that the class Kate is using is TPlannerMonthView and that actually resolves to the *MonthView* object mapping for Win32 controls.  This incorrect mapping may be causing some of her problems.



    The suggestion would be to turn off that mapping in the Win32 controls for the project in question and see if recording or other things work better afterwards.
  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi,

     

    I am using in a Delphi application a TPlannerMonthView component... But I can't set a selection between two dates !

     

    Does anyone could advise ?

     

    Thanks a lot,

     

    Mehdi