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.
- sameerjade7 years agoFrequent Contributor
Hi Robert,
You are correct, "QtObject("abc")" is not a direct child of "Aliases.MyApplicationName.Settings". It is more like this:
var checkBox = Aliases.MyApplicationName.Settings.QtObject("firstChild").QtObject("secondChild").QtObject("thirdChild").WaitQtObject("abc", 2000);
I also tried it this way but it still gives me "object does not exist" error.
var parent = Aliases.MyApplicationName.Settings.QtObject("firstChild").QtObject("secondChild").QtObject("thirdChild");
var checkBox = parent.WaitQtObject("abc", 2000);
Thanks.
- sameerjade7 years agoFrequent Contributor
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.
Related Content
- 4 years agoJackalNZZ
Recent Discussions
- 5 hours agosimonaferrara
- 13 hours agoSubhraDas
- 2 days agotramuntana