Ask a Question

Can't click on another tab without coordinates defined

SOLVED
ARANA
Occasional Contributor

Can't click on another tab without coordinates defined

Hi all,
I'm new to TestComplete and learning the tool myself. I am automating Desktop application. To start with, my approach is to create Keyword Tests for the scenario and then convert it into script which normally contains coordinates for 'Click' actions. I don't want the dependency on the coordinates in my scripts, so sometimes when I remove them from the scripts, the automated scripts fails ( not always).

For eg in below screen, in my keyword tests I'm clicking on 'Ledger Codes' which has coordinates (661,30) but when I remove them the script fails. I've tried using object spy to spy on the Ledger Codes tab but the Testcomplete can't spy on that particular ' Ledger Codes' tab. I've attached name mapping as well for reference. Is there any way I can click on Ledger tab without depending on coordinates please? 

ARANA_1-1678892099449.pngARANA_2-1678892178259.png

ARANA_3-1678892643539.png

 

7 REPLIES 7
rraghvani
Trusted Contributor

If you use the Object Browser, can you see the tabs?

 

rraghvani_0-1678900850720.png

 

AlexKaras
Community Hero

Hi,

 

I am automating Desktop application.

What your tested application was created with (.Net, Delphi, Java, ...) and what control is used for this tabbed view? (Or can you post here a screenshot of the Object Browser with the tabbed control been selected in it?)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
ARANA
Occasional Contributor

Hi both

Thanks for the quick response. The application is written in Delphi 5. Please find the object browser screenshot below. 

ARANA_0-1678958734887.png

 

rraghvani
Trusted Contributor

You might be able to do something like,

 

Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.ClickTab("Fund Codes");
Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.Click("Fund Codes");
Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.ClickItem("Fund Codes");
Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.pageFundCodes.Click(); // name mapping

 

In the Methods tab, there might be methods you can use to select your tab page.

 

See Testing Delphi Applications for more information.

ARANA
Occasional Contributor

Hi

I tried all the suggested options. None of them works.

1. 'ClickTab' method is not available for tnbGLSetup

2. 'Click' method option gives me mismatch error

3. 'ClickItem' method gives unable to find object error

4. Name mapping gives unable to find object error

 

I did further investigation using full name as well as below Sys.Process("Finance").VCLObject("dlgGLsetup").VCLObject("pnForm").VCLObject("tnbGLSetup").Window("TSPage", "Ledger Codes", 1).Click().

It get Non existent object error for Ledger Codes tab as screenshot in attached document

but it can find Fund Codes which is the default tab when this form is loaded.

I'm using Python for scripting. I checked with devs, with alt+tab we can click the tab in the application. Is there any way we can use alt +tab in the code?

rraghvani
Trusted Contributor

What you have written, using VCLObject, that ideally should have worked.

 

I've noticed, that each of your tabs have numbers which you can select using ALT + number.

rraghvani_0-1679047773496.png

You should be able to do something like, Sys.Process("Finance").VCLObject("dlgGLsetup").VCLObject("pnForm").VCLObject("tnbGLSetup").Keys("~1"); to select Fund Codes tab.

 

 

Note, in my previous example, the line 

Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.pageFundCodes.Click(); // name mapping

is based on having a name mapping for pageFundCodes.

ARANA
Occasional Contributor

I'm able to click on tab 5 using below options

 

1. Aliases.Finance.dlgGLsetup.pnForm.tnbGLSetup.Keys("~5")

or 
Sys.Process("Finance").VCLObject("dlgGLsetup").VCLObject("pnForm").VCLObject("tnbGLSetup").Keys("~5");

 

Thank you for your help...

cancel
Showing results for 
Search instead for 
Did you mean: