Forum Discussion
Hi,
How did you search for the object?
Can you provide us with your actual code, exact line of error and the error text iteself?
I think I figured out what went wrong, when trying to find the object by the first method, along with all these parent/sibling, the object becomes a non-testcomplete object, that's why it's not supported, so I've changed my code by using xpath to find it correclty, it works like a charm.. Thank you very much, Both of you :D
- AlexKaras9 years agoChampion Level 3
Hi,
Great to hear that the problem is solved.
And yes, your conclusion is absolutely correct and this was the reason for my first question about how the problematic object was obtained.
TestComplete can access application's objects and their internal methods. Also, for the objects that are found and referenced by the means of TestComplete, TestComplete 'wraps' them with its own wrappers that provide access to the additional methods provided by TestComplete.
If you are calling native method of some object and this method returns another object, then, obviously, this returned object will not be wrapped by TestComplete (because it was obtained not by its means) and thus will not contain methods provided by TestComplete.
So, in your code:
var ItemText = webPageObj.EvaluateXPath("//li[@id='"+ItemID+"']");
ItemText = (new VBArray(ItemText)).toArray();
var ItemRow = ItemText[0].firstChild;
var PlusIcon = ItemRow.nextSibling;
var ItemName = PlusIcon.nextSibling;
ItemText is an object obtained via TestComplete means and thus contains the .Drag method.
ItemRow and all other objects are obtained via the call to the native XPath functions, not wrapped by TestComplete and thus do not contain the .Drag method.
- Veroniquelu9 years agoContributor
Thank you Again
Related Content
- 5 years agosheetalhir
- 2 years agolhedgehog
- 11 months agoesoysal
- 2 years agoBetsy
Recent Discussions
- 3 hours agoMW_Didata
- 14 hours agod_gfleetwood92