Forum Discussion
Is there a direct child object under Aliases.MyApplicationName.Settings that is "QtObject("abc")"? If there is not, then the error you get is correct. Note that the "WaitQtObject" assumes that the object you're waiting fir is a DIRECT child of the parent object (in your case, Settings). If there are any other objects in the tree between Settings and QtObject("abc"), you'll get that error.
Is there any workaround to this situation? When I am trying to use WaitQtObject method on an object which is not a direct child of the main parent. By main parent I mean "Sys.Process('MyApp')"
- tristaanogre7 years agoEsteemed Contributor
Is there a reason why you haven't mapped the checkbox and given it an Alias? That would be the ultimate solution... this would "collapse" your tree so you wouldn't have to worry about the different layers if they aren't necessary. Then you can use WaitAliasChild to wait for the checkbox directly.
Keep in mind, on your original problem, all the PARENT objects need to exist as well before you can call the WaitQTObject that you've indicated... so, if firstChild, secondChild, or thirdChild don't exist in time, you'll get the error as well.
- Marsha_R7 years agoChampion Level 3
Regarding tristaanogre's comment about all the parent objects needing to be mapped, and in case you haven't already seen this feature, TestComplete will help you out with the needed parents.
If you go straight to the "abc" object and start to map that, there will be a wizard that offers to map everything above that object also. This way you don't have to try to go top-down and find what you want.
- sameerjade7 years agoFrequent Contributor
Hi Marsha.
Do you mean I can get prompts for parents upstream? I know if we enter an object, we get the drop-down prompts for the children.
How do we get this wizard to map parents above the object? Thank you.
- sameerjade7 years agoFrequent Contributor
Hi Robert. Thanks, that makes sense.
I should have probably mapped the checkbox. I simply used the object spy to get the Alias name of the checkbox and kept using it. i.e. Aliases.MyApp.Settings.QtObject("firstChild").QtObject("secondChild").QtObject("thirdChildl").QtObject("abc");
However, this checkbox object has been temporarily hidden/removed from our application and I want all scripts to simply ignore that part of script that was checking it. Since this object is no longer there, I am not sure how I can map it. Also, I do not want to completely remove the script part since it may come back.
About your second comment, yes, in this case all parent objects do exist (firstChild, secondChild, or thirdChild).
- Marsha_R7 years agoChampion Level 3
sameerjade wrote:
Hi Robert. Thanks, that makes sense.
I should have probably mapped the checkbox. I simply used the object spy to get the Alias name of the checkbox and kept using it. i.e. Aliases.MyApp.Settings.QtObject("firstChild").QtObject("secondChild").QtObject("thirdChildl").QtObject("abc");
However, this checkbox object has been temporarily hidden/removed from our application and I want all scripts to simply ignore that part of script that was checking it. Since this object is no longer there, I am not sure how I can map it. Also, I do not want to completely remove the script part since it may come back.
About your second comment, yes, in this case all parent objects do exist (firstChild, secondChild, or thirdChild).
-------------------------
If Object Spy can see the object, then you will be able to map it. However, your code may still fail depending on how the properties are set. You might want to comment out that bit until the object is used again.