Ask a Question

ClickTab with Icons

SOLVED
TimCalderwood
New Contributor

ClickTab with Icons

Our JavaFX application uses tabs with icons in the tab title. Looking at Object browser, the tabs have two labels, the first label is "" and the sub label has the tab text. So, when we try to use ClickTab, with the text, ClickTab fails. Using an index is not an option because there is no guarantee of what of the tab order is at any given time. I have not figured out a way to find the tab index correctly using the tab title. 

 

Therefore, what is the best way to select tabs when tabs use icons and text in the tab title? Attached is a screenshot of object viewer. 

1 ACCEPTED SOLUTION

Accepted Solutions
BenoitB
Community Hero

Re: ClickTab with Icons

A last solution would be to use image search of icons for tabs (assuming each tab has its own icon).

So add in image store your icons and search them in the parent object picture. After that you'll have coordinates where to click.

 

That is not perfect but it could work.

Un sourire et ça repart

View solution in original post

8 REPLIES 8
BenoitB
Community Hero

Re: ClickTab with Icons

You can access tab with browser model by page title perhaps (works only if page title change with tab)  ?

 

// Iexplorer/old Edge
let tabBand = browser.BrowserWindow(0).CommandBar.TabBand;
// Chrome/Firefox
let tabBand = browser.UIPage("chrome://browser/content/browser.xul").TabBand;

tabBand.TabButton(page.contentDocument.title).Click();



Un sourire et ça repart

Marsha_R
Community Hero

Re: ClickTab with Icons

Try using Find or FindChild to find the right tab and then get the index you need to do other things

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/find-m...


Marsha_R
[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
TimCalderwood
New Contributor

Re: ClickTab with Icons

I agree with FindChild and have used id usefully to get the sub label of the label. However, I have not been able to determine the index number of the tab that it is associated with it. Is there is a function of way to determine the index number of tab that contains the object returned by FindChild. 

BenoitB
Community Hero

Re: ClickTab with Icons

When spying look at the tab Method/functions instead of Properties tab, perhaps you can find an useful method

Un sourire et ça repart

sonya_m
Community Manager

Re: ClickTab with Icons

Thanks everyone!

 

@TimCalderwood were you able to find what you are looking for? Please share your progress with us!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
TimCalderwood
New Contributor

Re: ClickTab with Icons

I have been study that and several other part of the tools. I am still unable to determine the tab index of a tab.  

BenoitB
Community Hero

Re: ClickTab with Icons

A last solution would be to use image search of icons for tabs (assuming each tab has its own icon).

So add in image store your icons and search them in the parent object picture. After that you'll have coordinates where to click.

 

That is not perfect but it could work.

Un sourire et ça repart

View solution in original post

sonya_m
Community Manager

Re: ClickTab with Icons

Great idea, Benoit!

 

@TimCalderwood Did you give it a try? You should be able to get the coordinates.


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: