Ask a Question

Selecting child elements inside a textnode

SOLVED
Largent803
Contributor

Selecting child elements inside a textnode

I have a parent textnode which populates what looks like a menu option. What I need is to be able to at random select the one of

these elements. I have created a csv with the necessary information in it however, I do not know away to select the panel options which are select

when I select one of the menu options.

 

Here is an example of a element that is not the parent of the object. The parent is hidden to me.

 

textnode13

Then the following

Aliases.browser.pageXXXX.panel10

 

That is what the elements child name is that appears when I click on the item. Is there away to find out what the parent is of the panel options. Because the menu appears when the textnode is clicked. However, I can't find away to select any of the elements in the textnode menu options. Any ideas on which method to use in order to select the appropriate parent to the panels to add to the script.

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Selecting child elements inside a textnode

Hi,

 

The parent is hidden to me.

This is just not possible. Use Object Browser or Object Spy to examine the structure of your tested application and figure-out what elements you need for your test code and how these elements can be found. Then either add them to the NameMapping or (if stable and reliable mapping is inconvenient or not possible) write a code to search for the required element during runtime.

 

P.S. White TestComplete does its best to map elements during recording, this is not recommended for production use. The better approach is to examine the tested application before recording, map required elements so they are identified stably and uniquely and only then record your actions.

 

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
================================

View solution in original post

1 REPLY 1
AlexKaras
Community Hero

Re: Selecting child elements inside a textnode

Hi,

 

The parent is hidden to me.

This is just not possible. Use Object Browser or Object Spy to examine the structure of your tested application and figure-out what elements you need for your test code and how these elements can be found. Then either add them to the NameMapping or (if stable and reliable mapping is inconvenient or not possible) write a code to search for the required element during runtime.

 

P.S. White TestComplete does its best to map elements during recording, this is not recommended for production use. The better approach is to examine the tested application before recording, map required elements so they are identified stably and uniquely and only then record your actions.

 

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
================================

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: