I am testing a java application with a GUI made using eclipse (SWT). When I record mouse clicks, most of the time TestComplete recognizes different objects, but on the main window of the application, I have a form with four tabs. Each tab opens a different page (like in excel spreadsheet)
The problem is that TestComplete records the mouse clicks as coordinates. It does not recognice tabs as objects.
Does anybody have any idea about how can I create a more robust test script without recording click coordinates.
If your class doesn't match one of these four, that could be your problem.
Now, what you CAN do is open your project properties (right click on the project object in project explorer and select Edit | Properties) and select Object mapping. Click on Tab Control and then click Add Class. This will then prompt you for a string to enter to tell TC 4 which class to recognize as a Tab Control.
Apparently, the control used in your application cannot be mapped to the standard Win32TabControl object. Therefore, you should use its native methods to work with it. SWT applications should be recognized as Java Open applications by TestComplete, so you should have access to the native methods of the application objects. Please try to find a method that would select a tab by index or by name and call this method in your script. You can find the needed method by inspecting the methods of the tab control in the Object Browser panel or just ask your developers. Let us know your results.
Unfortunately, there is no way to pass a reference to a class or to an interface as an argument when calling a method of the application's object from a script. I would recommend that you implement some special methods that will do it in your application - as you have already guessed.
Thank you for your kind words about our tool and support. We appreciate your feedback.