Keep getting Object required error message when using FindAllChildren method
Hi everyone,
I was trying to use FindAllChildren method to look for an object from the parent, but I keep getting "VBScript runtime error. Object required: 'FindAllChildren(...)'" when I run the script below. But if I use Find or FindChild method, it worked fine. Can anyone help me what was wrong?
Sub test
sys.Browser("*").Page("*").Find("contentText", "CorelDRAW Graphics Suite 2019 Education Edition", 10).Parent.FindAllChildren("ObjectLabel", "Choose a language:", 50).ClickItem("Spanish")
End Sub
Thanks!
Hi whuang
Why are you combining FindAllChildren with a click ? FindAllChildren returns an array of items, not a single item, even if the array has a length of 1. TC probably won't know what to click. Since FindAllChildren excudes the current node, it is possible that by doing a FindAllChildren, you are excluding the one thing that TC can click, namely the parent. If you use a FindChild rather than FindAllChildren with exact riterai, you should get a single list to to clickitem on