Forum Discussion
Hi Saravana,
Thank you a lot for describing your approach. Quite useful.
> when I inspected it, its just empty
As it is documented for the QuerySelectorAll() method:
"
If a TestComplete web object matches the specified selector, then the array item contains this object.
If there is no matching TestComplete test object, the array item holds the appropriate HTML object.
If neither matching test objects, nor HTML objects were found, the method returns an empty array.
"
So, the above means that in your case TestComplete was able to find sought-for objects, but they did not match any object from TestComplete's objects tree in the Object Browser and thus native DOM objects were returned as the result of the search.
Native objects do not contain methods and properties added by TestComplete (e.g. .Exists, etc.) and (usually) cannot be inspected. However all their native methods and properties are accessible and can be used from test code (as it is illustrated on your screenshot #[3]). You just need to read the documentation for this or that DOM object for the provided native methods/properties.
Thanks a lot for your detailed explanation.
I read that and thought it is applicable for a search using CSS locator which is true (returns empty array if locator does not match).
I did not think that would be same for their Native objects as well (that where your experience comes :) ).
And I just found that this is not just the case for QuerySelectorAll, even if I go with the ObjectTree FullName property of an object, same result.
So its "NativeObjects" of Web elements I believe.
Related Content
- 4 years agoMr_Bro