Forum Discussion

jwaldron's avatar
jwaldron
New Contributor
15 years ago

Click Behavior Changed between V6 and V7

I have a number of scripts created in Version 6 of TC that I am trying to verify on Version 7.5. I've noticed that under V6 a click action executes no matter what the status of the object being clicked but under V7.5 the log just reports that the object was already selected. For most objects this isn't a problem but in one script I have the following code to select an option from a tab control.



w2.ClickTab('&Employee');


w2.PopupMenu.Click('[2]');




With V6 this works perfectly but under V7.5 the first line doesn't open the menu because the tab is already selected and the script fails because it can't obtain the popup menu. Is there a way to force the selection in line 1?

5 Replies

  • Hi John,




    TestComplete's behavior regarding tab controls has been changed in the latest version. So, the situation you are facing is expected. 




    Please let us know what tab control you are using and describe more minutely how the control behaves (when the popup menu shows up). We'll create a similar application here and try to provide you with a sample script demonstrating how to obtain the target popup menu.

  • jwaldron's avatar
    jwaldron
    New Contributor
    Unfortunately I have no access to the underlying code or understanding of the type of tab the programmers are using. I know the code is written in Delphi, I believe it is version 5 but couldn't swear to that. I also know our programmers have frequently designed custom controls rather than use standard options. The application has roughly 10 tabs along the left side of the main screen each of which when clicked present a popup submenu of choices. The problem I described occurs when you have selected one option from a given tab and performed whatever tasks you need on that screen and then need to go to another option from the same tab. TC 7 detects that that tab is already highlighted from the prior selection and does not actually perform the click on that tab when asked to do so where TC 6 would perform the click. Then the next step to select an option from the submenu can't be performed because the submenu has not been presented. I know I could work around this by selecting an option on another tab then going back and selecting the one I really want but this is a common task in our testing and I was hoping not to have to change every instance of this type of selection just to be able to migrate from TC 6 to TC 7.
  • Hi John,




    We are sorry for the inconvenient TestComplete behavior with your tab control.




    Another possible workaround is to use coordinate clicks within the tab control. We can create a function that gets coordinates of the needed tab within the tab control. With such a function, you just need to replace the ClickTab call with the coordinate click using the coordinates returned by the function. 




    If this suggestion is suitable for you, please provide us with more details about your application and the target tab control. Please follow the steps below:




    * run your application and TestComplete;

    * switch to the Object Browser panel;

    * expand the application process's node and make the application's main window object node visible;

    * make a screenshot of the object tree and send us the picture via the following web form:





    Also, please let us know the values of the target tab control's WndClass and VclClassName properties.

  • jwaldron's avatar
    jwaldron
    New Contributor
    That sounds like a lot more work than just adding a single line to the script to click on another tab then go back to the one I wanted. That works for this instance but it's a lot of editing since these tabs are essentially the main menu for our application so we are using them frequently in every test.



    The further I look the more this changed behavior of clicks is affecting us, not just on these tabs but on several other controls as well. I don't know why this was changed but it's starting to look like I might as well start over with recording my scripts if I want to upgrade. Sure would be nice if there were a global way to retain the old behavior to maintain backward compatibility.



    For now I think I'll just put V7 on the shelf and stick with V6. I don't need any of the new features.