Forum Discussion

JimWu986's avatar
JimWu986
Occasional Contributor
2 months ago
Solved

TestComplete 15 ToolBar.ClickItem cannot click split button ?

I thought I posted this question earlier but I do not see it in the recent questions list ... so try posting again. Sorry if duplicate.

I am new here and also new in TestComplete coding, all developers who did the coding before left the company. I am trying to pickup from what they did. I recently migrated our project from TestComplete12 to TestComplete15, and now trying to run the testcases. Of course there are a lot of problems. The first one I am trying to solve is the ToolBar.ClickItem 

So the section of the code is :

Aliases.MA.MainWindow.Activate
Set ToolBar = Aliases.MA.MainWindow2.zMAMainWindow_Toolbars_Dock_Area_Top
ClickMAToolbarItem = True
select Case(ucase(sItem))

Case "GO EN ROUTE"
    ToolBar.ClickItem("[4]|Operations|En Route|Go En Route")


The "Go En Route" button will show if clicking the down arrow on the right side of the "En Route" button

 

During the run, it cannot click the Go En Route button.

And earlier in the test, it was able to click the "Host Responses" button from this code

  Case "HOSTMESSAGES"
    Toolbar.ClickItem("[4]|Views|Host Responses")

Hope some of you Gurus can give me some ideas.

Thanks.

  • The other approach is to create a new project, and use the record and playback function, to record your actions, in script. So that you can see how TestComplete has identified your UI and the method used to interact with the control. You can apply the script code to your existing project. 

7 Replies

  • JimWu986's avatar
    JimWu986
    Occasional Contributor

    Sorry, I posted the same screenshot twice, here is the one without clicking the En Route down arrow

     

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    I've responded to similar post previously, and here are some of my answers -

    If you enable MSAA in Project Settings,

    Then majority of all ribbon controls (similar to Outlook) will be exposed to TestComplete, as shown below

    You should then be able to access the following menu New Items -> More Items -> Task Request using the following key word actions, against the ribbon bar in Outlook 365

    TestComplete might be recording the actions incorrectly for you - I suggest you remove PopupMenu and replace it with something similar to what is shown in the above image. Just to see if it works for you.

    Try to use the Click method as opposed to ClickItem method.

  • JimWu986's avatar
    JimWu986
    Occasional Contributor

    Thank you for the suggestion, I will give it a try.

  • JimWu986's avatar
    JimWu986
    Occasional Contributor

    Thanks for sharing more reading materials, I might need to find out how to manually map the split button correctly.

    On the TC Object Browser, I saw this "Open" Button in the Windows Explorer has this definition

    But on my En Route button, it is only a MenuItem


    Anyway, for now, the test step requires the order to be EnRoute, clicking the En Route button alone actually will go EnRoute, so I skipped the clicking of the sub button "Go En Route" and the testcase will not complain about the Go En Route no shown. I will figure out later if I could manually map the En Route button to be like the Open split button.

    I agree that I am not the right person to try the TestComplete migration, but since no one else is available, I have no choice. Fortunately, management did not rush me or set a deadline, and there are like a hundred testcases that I need to verify. I will just take my time.

    Thanks.

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      The other approach is to create a new project, and use the record and playback function, to record your actions, in script. So that you can see how TestComplete has identified your UI and the method used to interact with the control. You can apply the script code to your existing project.