Forum Discussion

jsayre's avatar
jsayre
Occasional Contributor
12 years ago

Microsoft ToolStrip and button interaction

I am trying to code a test that interacts with some Microsoft ToolStrip objects and detects some of their properties. So far, I have been rather unsuccessful with doing this.



I am using JScript and using the following logic:







if(Aliases.Program.frmMain.ToolStripContainer1.ToolStripContentPanel.tStripOuter.ToolStripPanel.ProgramToolStrip.wChecked(3))

  {

    Log.Message("The viewer is turned on. We are going to turn it off");

    //Clicks the 4th item of the 'ProgramToolStrip' bar.

    Aliases.Program.frmMain.ToolStripContainer1.ToolStripContentPanel.tStripOuter.ToolStripPanel.ProgramToolStrip.ClickItem(3);

  }







When I run this test, It just tells me that the object is not checked regardless of the objects actual state. If i run the ClickItem command on it's own, it works fine; Clicks the correct object.



I have tried several other methods of identifying this object and its state as well and I am out of ideas.



Any suggestions?
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Jeremy,


     


    According to the "wChecked Property (ToolBar Controls)" article, the wChecked property should check whether the specified item is enabled or disabled. What TestComplete version are you using? Try using TestComplete 9.31 - the latest product version.