Ask a Question

How to handle when most of the objects have a dynamic Parent

SOLVED
meenakshiyadav1
Contributor

How to handle when most of the objects have a dynamic Parent

I am working on automating a xamarin form based iOSapp. In this app 50-60% of core functionality is being covered in popups built using Rg.Plugins.Popup library.I am facing issue in automating these popup windows.As per smartbear support team TC does not support popup built with this plugin.

The issue is that TC does not read them as xamarin XF objects but treat them as regular iOS objects which is treating them as windows with dyanamic index.The index of thsese window changes after each navigation. For example if I am on x window right now which TC is showing as window(1) and I navigate to some other area of application and then come back to same x window then index of window changes and TC reads window as window(10) this Please find screenshot attached to see details of it.

This Window object is available in all popups of entire app.

Aliases.Device.processQaA36020.Window(28).ScrollView().Button("", 0) ---button object

Aliases.Device.processQaA36020.Window(39).PickerView().TableView(0) ------TableView object

I can not Map these object because of this dynamic window object.I have tried clicking on 'Ok' 'Cancel' button using FindChild Method(by mentioning "Aliases.Device.processQaA36020" as parent)but it does not seem to be stable as at times it works and next it does not.So I cannot automate complex functioanlity availble in these poup using FindChild method . Also this approach does not seem to be reliable to automate 50-60% functionality of the app.

Can anyone please suggest a wayout for this problem.

6 REPLIES 6
Manfred_F
Regular Contributor

Hi,

You can

1) map Your objects, then edit the mapping and replace the window Id by an asterisk ("*")

2) just map the parent window (also use the asterisk), and save the control object into a variable.

    To access the sub-objects, use customer-defined script routines, to which You hand in the parent variable.

    In the routine, navigate to Your Button and hand it back.

 

Regards,

Manfred

tristaanogre
Esteemed Contributor

You can also utilize "Extended Find" to bypass that Window entirely in your NameMapping.  


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
TanyaYatskovska
SmartBear Alumni (Retired)

Hi @meenakshiyadav1,

 

Did you resolve your question? 

 

Here are my 2 cents:

You can watch this short video explaining possible options:

https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/

 

Also, I've found great suggestions from @irina_lukina


Below, are several approaches that you can use in this case:

@tristaanogre

1. Use wildcards inside the target grid name. For instance, if your grid may have the following names: Grid1, Grid2, and so on, you can use the following mask for the window name - Grid*.

@tristaanogre

For more information, please refer to the Using Wildcards help topic.

@tristaanogre

2. Use the Find method to find the target window not by this name, but by the values of its properties.

@tristaanogre

3. Use wildcards in your name mapping scheme to map the window with the dynamic name. For more information, please refer to the Using Wildcards in Name Mapping help topic.


 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



Thanks a lot @Manfred_F  for taking time out to reply.Solution one is not working for me as I keep on getting a message that this does provide a unique maping criteria.

Can you please elaborate a little more (with an example if possible) on solution 2 .

 

Thanks in advance!!

 

Regarads,

Meenakshi

Thanks a lot @tristaanogre . This has resolved my issue for many objects but for few of them I am still facing issue as these object do not have enough properties to be able to get recognized uniqly. So when I skip dynamic parent and map these object to closeset stable parant they do not get recognized.

hi,

some more hints:

If You use asterisks in mapping conditions, and You get an error that criteria was not unique, this may have 2 causes:

1) there are several controls visible on the screen (= You can see them) which fulfil the criteria

2) there is only one control visible on the screen, but one or more invisible ones are also there. This occurs if Your application leaves controls not needed anymore in the tree for a while and just sets them invisible - as mine does. In this case, try adding condition "Visible = true" to the mapping. In the object browser, You can activate/deactivate the depiction of invisible objects.

 

You can also have a look at the help topic for the RefreshMappingInfo Method.

 

cancel
Showing results for 
Search instead for 
Did you mean: