Forum Discussion
- AlexKaras
Champion Level 3
Hi,
> .FindChildByXPath()
As per documentation:
If the object is searched by XPath and is found, TestComplete tries to match the found object to the one from its objects tree. If the match succeeds, then TestComplete returns its wrapping object that contains all properties and methods added by TestComplete (SetFocus(), .Keys(), etc.).
If the match fails, than native DOM object is returned. In this case test code can use only native properties/methods provided by DOM for this given object within given web browser.
If search by XPath fails then (as described in the XPath documentation) null is returned.
The above is one from a number of reasons why XPath is highly not recommended practice in TestComplete's world.
So, the reason of your problem is simple: XPath failed to find the sought for object.
Recommended correction that works in most of cases: replace .FindChildByXPath() with .FindChildEx() and provide long enough timeout value to guarantee that the sought for control is rendered on the screen.