Ask a Question

Not able to handle a dynamic object

SOLVED
meenakshiyadav1
Contributor

Not able to handle a dynamic object

I am working on Xamarin based iOS application. I am not able to handle a dynamic window object. I am trying to logout from application. As soon as I click on SignOut, an alert comes up for confirmation of signing out. I am not able to click on Yes though my script. When I  Map this Yes Action object it does not get recognized as one parent window object has dynamic index. (Object in red)

Aliases.Device.processQaA360.Window(8).AlertView().ScrollView(1).ActionView(0)

Above window object does not have enough properties to be able to get recognised uniqly. I have also added a screenshot of spy of this object. 

 

Even Find child  method is not working for me in this case. I am giving parent as "Aliases.Device.processQaA360" and then using Findchild method to retreive "ActionView(0)" object but  I am getting object not found not matter what depth i go to (I have used depth as 12).

 

can anyone pls suggest me a resolution to this.

6 REPLIES 6
SaravanaKumar_N
Contributor

Issue is not with AlertView but a parant window of it which has a dynamic index and there are not enough properties available to map it uniqly.In below shown heirarchy, objects in Green are constant but object in red is dynamic at times it is window(4) at time window(5) .I have also tries using wildcard "*" in name mapping but that does not work either.Can anyone please let me know how to handle it.

 

Aliases.Device.processQaA360.Window(8).AlertView().ScrollView(1).ActionView(0)

Okay, in the screenshot I can see the basic properties. Did you check for advanced properties? Anything helpful there?

https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-browser/view-mode...

 

And if '*' wildcard does not work, I think parent 'processQaA360' object has multiple 'Window' child objects.

If so did you check is there any difference in their properties?

The one you need may have certain unique value but others may have it different one like with 'Exists', 'Visible'.

 

AlexKaras
Champion Level 3

Hi,

 

a) In the Object Browser and Object Spy click the 'View more members' link that is above the Properties/Methods tabs. This will provide you with more properties with the chance that you will be able to find those that are stable and unique enough to make it possible to identify the problematic window.

 

b) It would help to see your code that does not work.

Below assumes that you did not modify Aliases hierarchy and it matches Namemapping one.

.FindChild() method must work, but you must call it for the processQaA360 object and specify search properties for AlertView.

Another option is to enable the Extended Find option for the AlertView object in the Namemapping (this column may be hidden and you should select Field Chooser context menu option to display it) and delete the Window(8) object from Namemapping so that all its child objects move up one level. See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/exte... for more details.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================

Thanks a lot Alex. Finally Find child method worked with approach mentioned in Point b in your answer.

Thanks Saravana for taking time out to answer my query.

cancel
Showing results for 
Search instead for 
Did you mean: